Level1Pet.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --[[
  2. Script Name : Spells/Summoner/Level1Pet.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.03.09 07:03:13
  5. Script Purpose :
  6. :
  7. --]]
  8. function cast(Caster, Target, PetID, Dif, HPMod, PWMod, Sz, SList)
  9. Pet = SummonPet(Caster, PetID)
  10. local Level = GetLevel(Pet)
  11. local HP = Level * HPMod
  12. local PW = Level * PWMod
  13. local CasterInt = GetInt(Caster)
  14. local StrMod = Dif * 3
  15. local Str = CasterInt + StrMod
  16. local NewHP = math.floor(HP)
  17. local NewPW = math.floor(PW)
  18. SpawnSet(Pet, "difficulty", Dif)
  19. SpawnSet(Pet, "size", Sz)
  20. --SetSpellList(Pet, SList)
  21. SetMaxHP(Pet, NewHP)
  22. ModifyHP(Pet, NewHP)
  23. SetMaxPower(Pet, NewPW)
  24. ModifyPower(Pet, NewPW)
  25. --Set Pet Attributes
  26. SetInfoStructFloat(Pet, "str", Str)
  27. SetStrBase(Pet, Str)
  28. SetInfoStructFloat(Pet, "agi", CasterInt)
  29. SetAgiBase(Pet, CasterInt)
  30. SetInfoStructFloat(Pet, "sta", CasterInt)
  31. SetStaBase(Pet, CasterInt)
  32. SetInfoStructFloat(Pet, "intel", CasterInt)
  33. SetIntBase(Pet, CasterInt)
  34. SetInfoStructFloat(Pet, "wis", CasterInt)
  35. SetWisBase(Pet, CasterInt)
  36. end
  37. function remove(Caster, Target)
  38. pet = GetPet(Caster)
  39. if pet ~= nil then
  40. DismissPet(pet)
  41. end
  42. end