![]() |
Will this work, and how to short it down - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Will this work, and how to short it down (/Thread-Will-this-work-and-how-to-short-it-down) |
Will this work, and how to short it down - Joe Loop - 12-14-2012 08:00 AM Please be gentle i am noobish at this .. i am working on my own elemental system, and right now i am at the part where monsters damage players with spells i want to give elemental damage, based on their spellpower. [events all humans/players get] <----- ON=@SpellEffect REF1=<SERV.UID.<SRC.UID>> // Caster REF2=<SERV.UID.<UID>> // Target If (<REF1.magery>>300.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | ((<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(22,45)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>200.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(15,35)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>150.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(10,35)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE REF1=<SERV.UID.<SRC.UID>> // Caster REF2=<SERV.UID.<UID>> // Target If (<REF1.magery>>135.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(10,30)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>99.9)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(10,25)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>90.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(10,20)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>80.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(10,15)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>70.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(8,15)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_MAGE_DAMAGED_ME_FOR=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>60.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(7,15)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>50.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (argn1>==69) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(5,12)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>40.0)&&(<argn1>==18) | (<argn1>==28) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(4,10)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>30.0)&&(<argn1>==18) | (<argn1>==28) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(3,8)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>20.0)&&(<argn1>==18) local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.firemagic=<EVAL <local.firemagic> + rand(2,5)> local.firemagic=<EVAL <local.firemagic> - <resfire>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>> ELSE If (<REF1.magery>>300.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(25,35)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>200.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(20,25)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>150.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(18,20)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>135.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(14,18)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>99.9)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(10,14)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>90.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(8,10)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>80.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(6,8)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>70.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(4,6)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>60.0)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(2,5)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>49.9)&&(<argn1>==20) | (<argn1>==39) local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.poisonmagic=<EVAL <local.poisonmagic> + rand(1,3)> local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>> ELSE If (<REF1.magery>>300.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(15,30)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>200.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(12,20)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>150.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(11,15)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>135.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(10,14)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>99.9)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(9,12)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>80.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(8,10)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>70.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(5,8)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>60.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(4,6)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>50.0)&&(<argn1>==30) | (<argn1>==42) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(2,5)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ELSE If (<REF1.magery>>40.0)&&(<argn1>==30) local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>> local.energymagic=<EVAL <local.energymagic> + rand(1,3)> local.energymagic=<EVAL <local.energymagic> - <resenergy>> REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>> ENDIF ON=@gethit REF1=<SERV.UID.<UID>> IF <REF1.CTAG0.A_Mage_Damaged_Me_For> ARGN1=<EVAL <REF1.CTAG.A_Mage_Damaged_Me_For>> REF1.CTAG.A_Mage_Damaged_Me_For= ARGN2=dam_god ARGN3=0 ENDIF i made out of stuff i found in here on the forums .. but it seems a little stupid and big .. how else to make it smaller but still retain the edibility... And please dont laugh at it ![]() RE: Will this work, and how to short it down - Shaklaban - 12-14-2012 06:58 PM well for custom spell effects i think using @effect under spells will be better solution like PHP Code: [Spell 18] you can use reflection_check and custom_spell_check functions im using them over one year because im using custom spell effects for necromancy and magery. but you need to create your own custom_fire_effect function because its just for one spell and i created it as an example. for larger use you need to create defnames like: [defname custom_magics] custom_magic_18_multip 150 custom_magic_18_damage_type dam_fire then you can use spell number as an argument and use it in function. after that you can call them in your scripts and you can use one function for all spells. and when you need to change power etc. of a spell you can just edit the defnames without messing with the scripts. RE: Will this work, and how to short it down - Joe Loop - 12-14-2012 08:48 PM fantastic! thats briliant, thank you |