Okay so i have figured out how to make-shift cast spells:
Find the spell book and set the spell index and charges:
Code:
while ((ent = FindEntityByClassname(ent, "tf_weapon_spellbook")) != -1)
{
if(ent)
{
if (GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity")==client)
{
SetEntProp(ent, Prop_Send, "m_iSelectedSpellIndex", spell);
SetEntProp(ent, Prop_Send, "m_iSpellCharges", 10);
}
}
}
Possible spells:
0 Fireball
1 Missile thingy (bats)
2 Ubercharge
3 Bomb
4 Super Jump
5 Invisible
6 Teleport
7 Electric Bolt
8 Small body, big head, speed
9 TEAM MONOCULUS
10 Meteor Shower
11 Skeleton Army (Spawns 3)
I used tf2 items to give my self a spell book, it is needed to cast spells.
Code:
SpawnWeapon(client, "tf_weapon_spellbook", 1069, 0, 0, "");
Spoiler
I found this to spawn the weapon.
Code:
stock SpawnWeapon(client,String:name[],index,level,qual,String:att[])
{
new Handle:hWeapon = TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
if (hWeapon == INVALID_HANDLE)
return -1;
TF2Items_SetClassname(hWeapon, name);
TF2Items_SetItemIndex(hWeapon, index);
TF2Items_SetLevel(hWeapon, level);
TF2Items_SetQuality(hWeapon, qual);
new String:atts[32][32];
new count = ExplodeString(att, " ; ", atts, 32, 32);
if (count > 0)
{
TF2Items_SetNumAttributes(hWeapon, count/2);
new i2 = 0;
for (new i = 0; i < count; i+= 2)
{
TF2Items_SetAttribute(hWeapon, i2, StringToInt(atts[i]), StringToFloat(atts[i+1]));
i2++;
}
}
else
TF2Items_SetNumAttributes(hWeapon, 0);
new entity = TF2Items_GiveNamedItem(client, hWeapon);
CloseHandle(hWeapon);
EquipPlayerWeapon(client, entity);
return entity;
}
I will probably make a plugin to change/cast spells on players.
Still trying to figure out how to show the "current spell" on hud. lol.