Raised This Month: $12 Target: $400
 3% 

[TF2] Casting Spells


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mitchell
~lick~
Join Date: Mar 2010
Old 10-30-2013 , 00:37   [TF2] Casting Spells
Reply With Quote #1

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 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.

Last edited by Mitchell; 10-30-2013 at 00:38.
Mitchell is offline
w1200441
Senior Member
Join Date: Dec 2011
Old 10-30-2013 , 05:54   Re: [TF2] Casting Spells
Reply With Quote #2

how did you find the m_iSelectedSpellIndex and m_iSpellCharges?
w1200441 is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 10-30-2013 , 08:16   Re: [TF2] Casting Spells
Reply With Quote #3

DataMaps or Netprops probatly
__________________
...
Oshizu is offline
Skyrider
AMX Mod X Beta Tester
Join Date: May 2005
Location: Netherlands
Old 10-30-2013 , 08:28   Re: [TF2] Casting Spells
Reply With Quote #4

Question will be if the spells continue to stay alive after Halloween is over.
__________________

Last edited by Skyrider; 10-30-2013 at 08:28.
Skyrider is offline
Send a message via AIM to Skyrider Send a message via MSN to Skyrider Send a message via Yahoo to Skyrider
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-30-2013 , 09:05   Re: [TF2] Casting Spells
Reply With Quote #5

Seems valve twerked the action slot taunt, so, this stuff is a bit messed up.
It's probably just easier to spawn the entity by name that the spellbook uses, its probably a tf_projectile or something... And then shoot it somewhere. That would be more useful that requiring all these other entities, a spellbook. Hud element... And requiring user input.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 10-30-2013 at 09:06.
friagram is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-30-2013 , 12:04   Re: [TF2] Casting Spells
Reply With Quote #6

Quote:
Originally Posted by friagram View Post
Seems valve twerked the action slot taunt, so, this stuff is a bit messed up.
It's probably just easier to spawn the entity by name that the spellbook uses, its probably a tf_projectile or something... And then shoot it somewhere. That would be more useful that requiring all these other entities, a spellbook. Hud element... And requiring user input.
Im actually looking into that right now!
I have a plugin up now.
https://forums.alliedmods.net/showthread.php?t=228982

Last edited by Mitchell; 10-30-2013 at 12:53.
Mitchell is offline
Requiesta
Senior Member
Join Date: May 2012
Location: Texas
Old 12-17-2013 , 17:50   Re: [TF2] Casting Spells
Reply With Quote #7

I know this is a bit of a necro but I've tried using that stock and although I can give players a spellbook it won't let them cast spells with it. I posted about it in the thread below, can someone (preferably the op who got it to work) tell me what I did wrong?

http://forums.alliedmods.net/showthread.php?t=231592
__________________
YouTuber, Modder, Accountant, and somehow I still enjoy programming after all that.

Check out my YouTube Channel.
Requiesta is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode