^TayfuN^ Annapolis Owner
Number of posts : 256 Main Character Name : TayfuN Registration date : 2007-06-29
| Subject: Wich Script use better ? Wed Aug 15, 2007 6:26 am | |
| This One: - Code:
-
//###################################### //###### Military City ###### //###### Npc events ###### //###################################### [EVENTS e_npc_general] ON=@Click if (<findid i_mem_evolution>) IF <FAME> < 10000 MESSAGE @026 <NAME> [<eval(<tag0.level>)>/<eval <findid.i_mem_evolution.tag0.evolution_step>>] ELSE MESSAGE @026 <SEX Lord/Lady> <NAME> [<eval(<tag0.level>)>/<eval <findid.i_mem_evolution.tag0.evolution_step>>] ENDIF RETURN 1 endif
ON=@Death if (<tag0.loot_flags>&npc_loot_money) f_loot_money endif if (<tag0.loot_flags>&npc_loot_reag) f_loot_reag endif
On=@GetHit if <flags> & statf_poisoned if <findlayer(42).id>!=0 findlayer(42).remove endif hits=<str> flags=<flags> & ~statf_poisoned update endif
ON=@SpellEffect if (<serv.spell.<argn1>.flags>&spellflag_resist) && (<flags>&statf_reflection) if (<src.detail>) src.sysmessage <name> reflects your spell. endif effect 3,i_fx_bless_effect,1,16,1,0,4 sfx 500 anim 30 flags=<flags>&~statf_reflection return 1 endif if (<src.uid>!=<uid>) && (<serv.spell.<argn1>.flags>&spellflag_resist) argn2=<eval((<argn2> - <magicresistance>/2 - <int>*2 + <src.int>*2 )> else argn2=<eval((<argn2> + <src.int>*2 )> endif
//Evolution [defname Evolution] evolution_timer 3600
[function f_npc_evolution] SERV.NEWITEM i_mem_evolution NEW.CONT=<UID> NEW.LINK=<UID> NEW.EQUIP NEW.tag0.evolution_id=<args> NEW.TIMER=<def.evolution_timer>
[itemdef i_mem_evolution] id=i_memory type=t_eq_script name=[Evolution Item]
ON=@Create attr=094
ON=@Timer if <cont> if (<tag0.evolution_step> < <eval(<link.tag0.level>*10)>) tag0.evolution_step=<eval(<tag0.evolution_step>+1)> link.ostr=<eval(<link.ostr>+(<link.tag0.level>*8))> link.hits=<eval(<link.hits>+(<link.tag0.level>*8))> link.odex=<eval(<link.odex>+(<link.tag0.level>*2))> link.stam=<eval(<link.stam>+(<link.tag0.level>*2))> link.oint=<eval(<link.oint>+(<link.tag0.level>*2))> link.mana=<eval(<link.mana>+(<link.tag0.level>*2))> link.fame=<eval(<link.fame>+(<link.tag0.level>*10))> link.karma=<eval(<link.karma>-(<link.tag0.level>*10))> elif (<tag0.evolution_step>==<eval(<link.tag0.level>*10)>) && !(<tag0.evolution_id>==0) serv.newnpc <tag0.evolution_id> new.ostr <link.ostr> new.odex <link.odex> new.oint <link.oint> new.hits <link.hits> new.stam <link.stam> new.mana <link.mana> new.home <link.home> new.p <link.p> new.kills <link.kills> new.karma <link.karma> new.fame <link.fame> link.remove remove else timer -1 endif timer <def.evolution_timer> return 1 endif [eof] - Code:
-
//###################################### //###### Military City ###### //###### Npc loot ###### //######################################
[defname loot_templates] template_loot_money_1 {5 30} template_loot_money_2 {30 60} template_loot_money_3 {60 100} template_loot_money_4 {100 180} template_loot_money_5 {180 250} template_loot_money_6 {250 350} template_loot_money_7 {350 500} template_loot_money_8 {500 700} template_loot_money_9 {700 1000} template_loot_money_10 {1000 2000}
npc_loot_money 000001 npc_loot_reag 000002 npc_loot_gems 000004 npc_loot_scroll 000008 npc_loot_weapon 000010 npc_loot_armor 000020 npc_loot_rares 000040 npc_loot_maps 000080
template_reagents { i_reag_black_pearl 1 i_reag_blood_moss 1 i_reag_garlic 1 i_reag_ginseng 1 i_reag_mandrake_root 1 i_reag_nightshade 1 i_reag_sulfur_ash 1 i_reag_spider_silk 1 } template_gems { i_gem_granate 9 i_gem_amber 8 i_gem_ruby 7 i_gem_sapphire 6 i_gem_tourmaline 5 i_gem_citrine 4 i_gem_emerald 3 i_gem_amethyst 2 i_gem_diamond 1 }
template_first_circle { i_scroll_reactive_armor 1 i_scroll_clumsy 1 i_scroll_create_food 1 i_scroll_feeblemind 1 i_scroll_heal 1 i_scroll_magic_arrow 1 i_scroll_night_sight 1 i_scroll_weaken 1 } template_second_circle { i_scroll_agility 1 i_scroll_cunning 1 i_scroll_cure 1 i_scroll_harm 1 i_scroll_magic_trap 1 i_scroll_magic_untrap 1 i_scroll_protection 1 i_scroll_strength 1 } template_third_circle { i_scroll_bless 1 i_scroll_fireball 1 i_scroll_magic_lock 1 i_scroll_poison 1 i_scroll_telekinesis 1 i_scroll_teleport 1 i_scroll_unlock 1 i_scroll_wall_of_stone 1 } template_fourth_circle { i_scroll_archcure 1 i_scroll_archprotection 1 i_scroll_curse 1 i_scroll_fire_field 1 i_scroll_greater_heal 1 i_scroll_lightning 1 i_scroll_mana_drain 1 i_scroll_recall 1 } template_fifth_circle { i_scroll_blade_spirits 1 i_scroll_dispel_field 1 i_scroll_incognito 1 i_scroll_magic_reflection 1 i_scroll_mind_blast 1 i_scroll_paralyze 1 i_scroll_poison_field 1 i_scroll_summon_creature 1 } template_sixth_circle { i_scroll_dispel 1 i_scroll_energy_bolt 1 i_scroll_explosion 1 i_scroll_invisibility 1 i_scroll_mark 1 i_scroll_mass_curse 1 i_scroll_paralyze_field 1 i_scroll_reveal 1 } template_seventh_circle { i_scroll_chain_lightning 1 i_scroll_energy_field 1 i_scroll_flamestrike 1 i_scroll_gate_travel 1 i_scroll_mana_vampire 1 i_scroll_mass_dispel 1 i_scroll_meteor_swarm 1 i_scroll_polymorph 1 } template_eighth_circle { i_scroll_earthquake 1 i_scroll_energy_vortex 1 i_scroll_resurrection 1 i_scroll_summon_elem_air 1 i_scroll_summon_daemon 1 i_scroll_summon_elem_earth 1 i_scroll_summon_elem_fire 1 i_scroll_summon_elem_water 1 }
template_loot_scroll_1 { template_first_circle 1 template_second_circle 2} template_loot_scroll_2 { template_first_circle 1 template_second_circle 1 template_third_circle 2} template_loot_scroll_3 { template_second_circle 1 template_thrird_circle 1 template_fourth_circle 2} template_loot_scroll_4 { template_thrird_circle 1 template_fourth_circle 1 template_fifth_circle 2} template_loot_scroll_5 { template_fourth_circle 1 template_fifth_circle 1 template_sixth_circle 2} template_loot_scroll_6 { template_fifth_circle 1 template_sixth_circle 1 template_seventh_circle 2} template_loot_scroll_7 { template_sixth_circle 1 template_seventh_circle 1 template_eighth circle 2} template_loot_scroll_8 { template_seventh_circle 1 template_eighth circle 1} template_loot_scroll_9 { template_eighth circle 1} template_loot_scroll_10 { template_eighth circle 1} // Necros spells add here :)
[function f_loot_reag] FOR <tag.level> serv.newitem <def.template_reagents> new.amount {<tag.level> <eval(<tag.level>*10)>} new.bounce ENDFOR
[function f_loot_money] local.money=<def.template_loot_money_<eval(<tag.level>)>> FOR <eval(1+(<local.money>/50000))> serv.newitem i_gold new.amount <qval (<local.money> < 50000) ? <local.money> : 50000> new.bounce local.money=<eval(<local.money>-50000)> ENDFOR if (<findid.i_mem_evolution.tag0.evolution_step>>0) FOR <findid.i_mem_evolution.tag0.evolution_step> serv.newitem i_gold new.amount <eval((<def.template_loot_money_<eval(<tag.level>)>>*100)/1000)> new.bounce ENDFOR endif
[eof] Or This One: - Code:
-
[EVENTS e_npcs] [email]ON=@Click[/email] IF (<TAG0.NAME.HUE>) LOCAL.COLOR=<TAG0.NAME.HUE> ELIF ((((<REGION.FLAGS>®ion_flag_guarded) || (<REGION.FLAGS>®ion_flag_safe)) && ((<BODY>==c_man) || (<BODY>==c_woman) || (<ISVENDOR>))) || (<FLAGS>&statf_invul)) LOCAL.COLOR=04ac ELIF (<ISPK>) LOCAL.COLOR=0eb ELIF (<ISCRIMINAL>) LOCAL.COLOR=946 ELSE LOCAL.COLOR=88 ENDIF LOCAL.REALNAME=<NAME> IF (STRMATCH(* the*,<SERV.CHARDEF.<BASEID>.NAME>)) && !(STRMATCH(* the*,<NAME>)) LOCAL.REALNAME .= , <STRSUB <HVAL (StrIndexOf(<SERV.CHARDEF.<BASEID>.NAME>,the,0))> 99 <SERV.CHARDEF.<BASEID>.NAME>> ENDIF MESSAGE @<LOCAL.COLOR>,3,1 <LOCAL.REALNAME> RETURN 1 [email]ON=@Attack[/email] IF (<SRC.ISEVENT.e_young>) IF !(<SRC.TAG0.EVENT.ID>) IF !(0<SRC.ISFIGHTINGME <UID>>) ACTION -1 RETURN 1 ENDIF ENDIF ENDIF [email]ON=@NpcActFollow[/email] IF !(<ISVENDOR>) IF (<DISTANCE> > 6) IF (<MAGERY>) IF !(<R25>) GO <SRC.P> MOVEBACK ENDIF ENDIF IF (<ARCHERY>) IF !(<FINDLAYER.2>) LOCAL.BOW=<FINDTYPE.T_WEAPON_BOW> LOCAL.XBOW=<FINDTYPE.T_WEAPON_XBOW> IF (<LOCAL.BOW>) EQUIP <LOCAL.BOW> ELIF (<LOCAL.XBOW>) EQUIP <LOCAL.XBOW> ENDIF ENDIF ENDIF ENDIF ENDIF [email]ON=@DEATH[/email] LOCAL.TMP=<OBJ> OBJ=<MEMORYFINDTYPE.memory_ispawned.LINK> OBJ.TIMER=<HVAL {<OBJ.MOREX> <OBJ.MOREY>}*60> NEWGOLD <HVAL (<maxhits>/4)+(<dex>/4)+(<int>/4)> OBJ=<LOCAL.TMP> IF (<ACT>) FORCHARMEMORYTYPE MEMORY_FIGHT COLOR |= <DEF.memory_harmedby> ENDFOR IF (<ACT.ISPLAYER>) IF (0<R<ACT.LUCK>> > <R200,2700>) RANDMAGICITEM ENDIF ENDIF IF !(STRCMPI(Doom,<REGION.NAME>)) NEWLOOT i_reag_daemon_bone,<HVAL (<maxhits>/17)+(<dex>/13)+(<int>/12)> ENDIF IF (<act.isplayer>) IF !(<ISTEVENT.e_champion>) && !(<ISEVENT.e_champion_minion>) && (STRCMPI(Doom,<REGION.NAME>)) IF (<MAP> > 1) || ((<P.X> > 5104) && (<P.Y> > 2216)) IF (<MAXHITS> > 200) IF !(<R25>) SERV.NEWNPC=<BASEID> NEW.HOME=<NEW.P> NEW.HOMEDIST=6 NEW.COLOR=04ac NEW.NAME .= (Paragon) NEW.STR *= 3 NEW.DEX *= 2 NEW.INT *= 3 NEW.MAXHITS += <HVAL <NEW.MAXHITS>/3> NEW.HITS=<NEW.MAXHITS> NEW.STAM=<NEW.MAXSTAM> NEW.MANA=<NEW.MAXMANA> NEW.KARMA -9000 NEW.FAME *= 2 NEW.NPC brain_monster OBJ=<NEW> NEW.ADDGOLD <HVAL <RESCOUNT i_gold>*3> OBJ.REMOVETIMER <HVAL 60*15> OBJ.RANDMAGICITEM OBJ.RANDMAGICITEM IF !(<R20>) NEWLOOT={minorartis} ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF [email]ON=@DeathCorpse[/email] IF !(<ISEMPTY <TAG.LOOTRIGHTLIST>>) TRY UID.<ARGO.UID>.TAG0.LOOTRIGHTLIST=<TAG0.LOOTRIGHTLIST> ENDIF TAG.LOOTRIGHTLIST if (<magery>) NEWLOOT i_reag_eye_of_newt,<HVAL ((<MAGERY>*2)+100)/100> endif IF !(<R3>) NEWLOOT i_reag_bone ENDIF IF (<act.isplayer>) IF (<ISPK>) IF (<maxhits> > 50) || (<dex> > 50) || (<int> > 50) NEWLOOT i_silver_coin,<HVAL (<maxhits>/6)+(<dex>/4)+(<int>/4)>,<argo.uid> ENDIF ENDIF ENDIF [email]ON=@GetHit[/email] IF (<src>!=<uid>) IF !(<TAG0.GOTHIT>) IF (<SRC.NPC>==brain_dragon) && !(<SRC.FLAGS>&statf_pet) && !(<FLAGS>&statf_pet) RETURN 1 ENDIF IF (<SRC.ISPLAYER>) IF (((<REGION.FLAGS>®ion_flag_guarded) && ((<BODY>==c_man) || (<BODY>==c_woman))) || ((<ISVENDOR>) && !(<KARMA> < -1000))) ARGN1=1 HITS += 1 RETURN 0 ENDIF IF (<SRC.REGION.FLAGS>®ion_flag_guarded) && !(<REGION.FLAGS>®ion_flag_guarded) GO <HOME> SPELLEFFECT S_CURE,1000 SPELLEFFECT S_DISPEL,1000 RETURN 1 ENDIF IF (<SRC.ISEVENT.e_young>) IF !(0<SRC.ISFIGHTINGME <UID>>) SRC.ATTACK <UID> ENDIF ENDIF IF ((<FINDLAYER.2.TYPE>==T_WEAPON_BOW) || (<FINDLAYER.2.TYPE>==T_WEAPON_XBOW)) && (<DISTANCE> < 2) UNEQUIP <FINDLAYER.2> ENDIF IF (<ARGN2>&DAM_MAGIC) IF (<SRC.FINDLAYER.1.TAG0.MAGICDAMINCREASE>) ARGN1 += <HVAL (<ARGN1>*<SRC.FINDLAYER.1.TAG0.MAGICDAMINCREASE>)/100> ENDIF ENDIF ENDIF IF (<FLAGS>&STATF_POISONED) IF !(<R7>) SPELLEFFECT S_CURE,<MAGERY>,<UID> ENDIF ENDIF IF (<SRC.FLAGS>&statf_conjured) IF !(<R20>) SRC.SPELLEFFECT S_DISPEL,1000,<UID> ENDIF ENDIF IF !(<R20>) SPELLEFFECT S_GREATER_HEAL,<QVAL <MAGERY> ? <MAGERY>:500>,<UID> ENDIF LOCAL.DEFEND=<AC> IF (<LOCAL.DEFEND> > 85) LOCAL.DEFEND=85 ENDIF ARGN1 -= <HVAL (<ARGN1>*<LOCAL.DEFEND>)/100> TAG.GOTHIT=1 FINDID.i_rune_paralyze.TIMERD=1 IF (<FLAGS>&statf_freeze) FLAGS &= ~statf_freeze ENDIF IF ((STRMATCH(*t_weapon*,<SRC.FINDLAYER.1.TYPE>)) || (STRMATCH(*t_weapon*,<SRC.FINDLAYER.2.TYPE>)) || (<SRC.ACTION> == SKILL_WRESTLING)) SRC.SKILLGAIN <SERV.SKILL.<SRC.ACTION>.KEY> 10 ENDIF DAMAGE <ARGN1> <DEF.DAM_GOD> <SRC> RETURN 1 ELSE TAG.GOTHIT ENDIF ENDIF [email]ON=@SpellEffect[/email] IF (<src>!=<UID>) IF !(<serv.spell.<argn1>.flags>&SPELLFLAG_GOOD) LOCAL.CIRCLE=<SPELLCIRCLE <ARGN1>> IF (<OBODY>!=C_ELF_MALE) && (<OBODY>!=C_ELF_FEMALE) LOCAL.CHANCE=<HVAL <LOCAL.CIRCLE>+6> LOCAL.CHANCE2=<HVAL <LOCAL.CIRCLE>+6> ELSE LOCAL.CHANCE=<HVAL <LOCAL.CIRCLE>+8> LOCAL.CHANCE2=<HVAL <LOCAL.CIRCLE>+8> ENDIF IF (<LOCAL.CIRCLE>==1) LOCAL.CHANCE=5 LOCAL.CHANCE2=2 ENDIF IF (<R<HVAL <MagicResistance>/<LOCAL.CHANCE>>> > <R<HVAL <ARGN2>*2>>) effect 3,i_fx_glow,16,20 RETURN 1 ENDIF ENDIF ENDIF [email]ON=@HitTry[/email] IF (<SRC.FINDLAYER.2.TYPE>==T_SHIELD) IF (<SRC.FINDLAYER.2.TAG0.HITCHANCEDECREASE>) IF (<ACTDIFF> > 0) ACTDIFF -= <EVAL (<ACTDIFF>*<SRC.FINDLAYER.2.TAG0.HITCHANCEDECREASE>)/100> ENDIF ENDIF ENDIF IF (<ARGN1> < 20) ARGN1=20 ENDIF [email]ON=@Hit[/email] IF (<SRC.FINDLAYER.2.TYPE>==T_SHIELD) LOCAL.BASEPARRYCHANCE=<HVAL (<SRC.PARRYING>-<SRC.BUSHIDO>)/40> IF (<LOCAL.BASEPARRYCHANCE> < 0) LOCAL.BASEPARRYCHANCE=0 ENDIF ELIF (STRMATCH(*t_weapon*,<SRC.FINDLAYER.1.TYPE>)) IF !(<SRC.FINDLAYER.1.TWOHANDS>) LOCAL.PARRYNEW=<HVAL (<SRC.PARRYING>*<SRC.BUSHIDO>)/48000> LOCAL.PARRYLEGACY=<HVAL <SRC.PARRYING>/80> IF (<LOCAL.PARRYNEW> > <LOCAL.PARRYLEGACY>) LOCAL.BASEPARRYCHANCE=<LOCAL.PARRYNEW> ELSE LOCAL.BASEPARRYCHANCE=<LOCAL.PARRYLEGACY> ENDIF ENDIF ELIF (STRMATCH(*t_weapon*,<SRC.FINDLAYER.2.TYPE>)) && (<FINDLAYER.2.TYPE>!=t_weapon_bow) && (<FINDLAYER.2.TYPE>!=t_weapon_xbow) IF (<SRC.FINDLAYER.2.TWOHANDS>) LOCAL.PARRYNEW=<HVAL (<SRC.PARRYING>*<SRC.BUSHIDO>)/41140> LOCAL.PARRYLEGACY=<HVAL <SRC.PARRYING>/80> IF (<LOCAL.PARRYNEW> > <LOCAL.PARRYLEGACY>) LOCAL.BASEPARRYCHANCE=<LOCAL.PARRYNEW> ELSE LOCAL.BASEPARRYCHANCE=<LOCAL.PARRYLEGACY> ENDIF ENDIF ENDIF IF (<LOCAL.BASEPARRYCHANCE>) SRC.SKILLGAIN 45 Parrying SRC.SKILLGAIN 60 Bushido IF (<SRC.PARRYING> >= 100.0) || (<SRC.BUSHIDO> >= 100.0) LOCAL.BASEPARRYCHANCE += 5 ENDIF IF (<R<LOCAL.BASEPARRYCHANCE>> > <R100>) SRC.SYSMESSAGELOC 946,3,1063353 SRC.SKILLGAIN 20 Parrying SRC.SKILLGAIN 35 Bushido RETURN 1 ENDIF ENDIF [EOF] | |
|
Marco Moderator
Number of posts : 837 Main Character Name : Avril Registration date : 2007-06-29
| Subject: Re: Wich Script use better ? Wed Aug 15, 2007 12:47 pm | |
| Ok, now tell what's this? lol | |
|
^TayfuN^ Annapolis Owner
Number of posts : 256 Main Character Name : TayfuN Registration date : 2007-06-29
| Subject: Re: Wich Script use better ? Wed Aug 15, 2007 1:15 pm | |
| its like combat system, but for NPC | |
|
Marco Moderator
Number of posts : 837 Main Character Name : Avril Registration date : 2007-06-29
| Subject: Re: Wich Script use better ? Wed Aug 15, 2007 4:51 pm | |
| | |
|
Sponsored content
| Subject: Re: Wich Script use better ? | |
| |
|