diff options
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/itemsystem/items/spell_fireball.lua | 26 | ||||
| -rw-r--r-- | gamemode/npcsystem/loadnpcs.lua | 56 | ||||
| -rw-r--r-- | gamemode/shared/player_spellcast.lua | 4 |
3 files changed, 26 insertions, 60 deletions
diff --git a/gamemode/itemsystem/items/spell_fireball.lua b/gamemode/itemsystem/items/spell_fireball.lua index d8bad79..11b12b3 100644 --- a/gamemode/itemsystem/items/spell_fireball.lua +++ b/gamemode/itemsystem/items/spell_fireball.lua @@ -17,8 +17,29 @@ ITEM.Recipe = { ITEM.CD = 1 -function ITEM:DoFireball() - print("Fully successfull fireball callback") +function ITEM:DoFireball(pl) + print("Fully successfull fireball callback:") + print(pl) + local aim = pl:GetAimVector() + local fireball = {} + fireball["model"] = "models/hunter/blocks/cube025x025x025.mdl" + fireball["speed"] = 700 + fireball["drop"] = 50 + fireball["init"] = function(fb) fb:Ignite(10) end + + local D = ents.Create("ws_projectile") + if(fireball.speed) then D.speed = fireball.speed end + if(fireball.model) then D.model = fireball.model end + if(fireball.drop) then D.drop = fireball.drop end + if(fireball.init) then D.init = fireball.init end + + print("D's speed:" .. D.speed) + + D:SetPos(pl:GetShootPos()+aim*50) + D:SetOwner(pl) + D:SetAngles(aim:Angle()) + D:Spawn() + pl:EmitSound(Sound("physics/flesh/flesh_impact_hard.wav"),100,math.random(90,110)) end function ITEM:DoFireballFail() @@ -26,6 +47,7 @@ function ITEM:DoFireballFail() end function ITEM:OnPrimary(pl,tr) + ParticleEffect("particletest.pcf",pl:GetPos(),pl:GetAngles(),pl) if (CLIENT) then return end pl:Cast("Fireball",self.DoFireball) end diff --git a/gamemode/npcsystem/loadnpcs.lua b/gamemode/npcsystem/loadnpcs.lua index c522400..9bf839b 100644 --- a/gamemode/npcsystem/loadnpcs.lua +++ b/gamemode/npcsystem/loadnpcs.lua @@ -39,59 +39,3 @@ function GetNpcByName(name) return nil
end
---[[
-function GM:SpawnNPCByName(name,pos)
- print("Server side, spawning bird!")
-
- entdata = GetNpcByName(name)
- if not entdata then
- print("NPC not found!")
- return
- end
- ent = ents.Create("ws_npc_ambient")
- ent:SetPos(pos)
-
-
- if(entdata.Speed) then
- ent.Speed = entdata.Speed
- end
- if(entdata.Model) then
- ent.Model = entdata.Model
- end
- if(entdata.vitality) then
- ent:SetHealth(entdata.vitality)
- end
- if(entdata.Drops) then
- ent.Drops = entdata.Drops
- end
- if(entdata.OnDammage) then
- ent.OnDammage = entdata.OnDammage
- end
- if(entdata.Behave) then
- ent.Behave = entdata.Behave
- end
- if(entdata.Act) then
- ent.Act = entdata.Act
- end
- ent:Spawn()
-end
-]]
---[[
-function GetRecipeForItem(name)
- for k,v in pairs( GAMEMODE.Recipes ) do
- if (v.Name == name) then return v.Recipe,v end
- end
-
- return nil
-end
-]]--
---[[
-function GetItemsByClass(class)
- local Dat = {}
- for k,v in pairs( GAMEMODE.Items ) do
- if (v.Class == class) then table.insert(Dat,v) end
- end
-
- return Dat
-end
-]]--
diff --git a/gamemode/shared/player_spellcast.lua b/gamemode/shared/player_spellcast.lua index fcc9484..0cf2108 100644 --- a/gamemode/shared/player_spellcast.lua +++ b/gamemode/shared/player_spellcast.lua @@ -19,8 +19,8 @@ if(SERVER) then net.Receive("FinishedCasting",function(len,pl) if(pl.casting) then - print("Finished casting message received by server") - pl.casting(net.ReadInt(BITCOUNT)) + print("Finished casting message received by server: " .. pl:Nick()) + pl.casting(net.ReadInt(BITCOUNT),pl) pl.casting = nil end end) |
