diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-08-18 23:38:32 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-08-18 23:38:32 -0300 |
commit | b2fd1598ed6974862dee8ca90ce516b9560dafd9 (patch) | |
tree | 9ae0d7479e3174816db44c002503437e4729c85b | |
parent | 4871f91c277df6bd1149285bb8dc1b8333248fcf (diff) | |
download | serverdata-b2fd1598ed6974862dee8ca90ce516b9560dafd9.tar.gz serverdata-b2fd1598ed6974862dee8ca90ce516b9560dafd9.tar.bz2 serverdata-b2fd1598ed6974862dee8ca90ce516b9560dafd9.tar.xz serverdata-b2fd1598ed6974862dee8ca90ce516b9560dafd9.zip |
Make Trap skill - available via Trickmaster, Class: Advanced
(On that note, 100 DMG per level might be TOO LOW)?
-rw-r--r-- | npc/003-0/trickmaster.txt | 5 | ||||
-rw-r--r-- | npc/config/duplicates.txt | 4 | ||||
-rw-r--r-- | npc/config/magic.txt | 5 | ||||
-rw-r--r-- | npc/magic/traps.txt | 31 |
4 files changed, 30 insertions, 15 deletions
diff --git a/npc/003-0/trickmaster.txt b/npc/003-0/trickmaster.txt index 14885874c..c00a31f2d 100644 --- a/npc/003-0/trickmaster.txt +++ b/npc/003-0/trickmaster.txt @@ -108,10 +108,11 @@ function standardMagic { function advancedMagic { if (MAGIC_LVL < 2) goto L_NoMagic; - mes l(".:: There are no skills ::."); - mesc l("You can bug Jesusalva to extend the Battlefield Control skills."); + mes l(".:: Make Trap ::."); + mesc l("Drop a trap in the ground. Players and monsters passing through it will take damage and get stunned. Require a %s and has a limited number of triggers.", getitemlink(IronOre)); mes ""; menuint + l("Make Trap"), TMW2_TRAPS, l("Cancel"), 0; return; } diff --git a/npc/config/duplicates.txt b/npc/config/duplicates.txt index cdf24ed61..026499363 100644 --- a/npc/config/duplicates.txt +++ b/npc/config/duplicates.txt @@ -14,8 +14,8 @@ OnInit: initnpctimer; end; -// Cleans every 15s -OnTimer15000: +// Cleans every 1s +OnTimer1000: .@t = gettimetick(2); .@iter = htiterator($@_DUPES); diff --git a/npc/config/magic.txt b/npc/config/magic.txt index ed6a8dbc7..58ceedccf 100644 --- a/npc/config/magic.txt +++ b/npc/config/magic.txt @@ -521,7 +521,7 @@ OnInit: RegisterMagic(1, MG_FIREWALL, 10, Lockpicks, 1, CLASS_TRICKS, 25); RegisterMagic(1, AC_VULTURE, 2, Lockpicks, 1, - CLASS_TRICKS, 250); + CLASS_TRICKS, 250, false, TMW2_TRAPS); RegisterMagic(1, SA_FREECAST, 1, Lockpicks, 1, CLASS_TRICKS, 25); RegisterMagic(1, ALL_FULL_THROTTLE, 1, Lockpicks, 1, @@ -530,7 +530,8 @@ OnInit: CLASS_TRICKS, 25); RegisterMagic(2, NV_TRICKDEAD, 1, Lockpicks, 1, CLASS_TRICKS, 25); - + RegisterMagic(3, TMW2_TRAPS, 10, Lockpicks, 1, + CLASS_TRICKS, 300, AC_VULTURE, false); diff --git a/npc/magic/traps.txt b/npc/magic/traps.txt index 65da75e69..c84795be6 100644 --- a/npc/magic/traps.txt +++ b/npc/magic/traps.txt @@ -8,28 +8,28 @@ function script SK_Traps { .@lv = getskilllv(TMW2_TRAPS); .@ab = abizit() * 2; - // TODO: Determine duration, power, stun time; use abizit too // More abizit: Longer duration and stun time // Higher level: Longer duration and power .@length=40 + (.@lv+.@ab)*4; // Max duration: 120 seconds .@power =.@lv * 100; - .@stun =.@ab * 6 / 5; // Up to 12s of stun time (2,4,7,9,12 seconds) - .@n$ = sprintf("sk#_%06d_%06d_%01d_%05d", getcharid(0), .@power, .@stun, htsize($@_DUPES)); + .@stun =(1+abizit()) * 9 / 6; // Up to 9s of stun time (1,3,4,6,7,9 seconds) + // Sanitization + .@power = min(99999, .@power); + .@n$ = sprintf("#sk_%06d_%d_%01d_%03d", getcharid(0), .@power, .@stun, htsize($@_DUPES)); getmapxy(.@m$, .@x, .@y, 0); - npc_duplicate("sk#trap", .@n$, .@m$, .@x, .@y); + //npc_duplicate("sk#trap", .@n$, .@m$, .@x, .@y); + npc_duplicate("sk#trap", .@n$, .@m$, .@x, .@y, NPC_TRAP, 0, 0, 0); htput($@_DUPES, .@n$, gettimetick(2) + .@length); + set(getvariableofnpc(.capacity, .@n$), .@length); // Get a few mana experience points (this is NOT used by Mana Stone) GetManaExp(TMW2_TRAPS, rand2(1,.@lv)); return; } -// Copy from 026-7/config, and htput($@_DUPES, "new_npc_name", expiration_tick) -// Syntax: sk#_CharID_dmg_stun_{uuid} -// 3 + 6 + (up to 6) + 1 = 15 out of 22 chars (5 for UUID) -// So UUID -// We'll also need another trap function +// Syntax: #sk_CharID_dmg_stun_{uuid} +// 4+ 3 + 6 + (up to 5) + 1 = 19 out of 22 chars (3 for UUID) boss,0,0,0 script sk#trap NPC_TRAP,0,0,{ end; @@ -37,6 +37,17 @@ OnTouch: .@id=getcharid(0); // FALLTHROUGH OnTouchNPC: + // Capacity exausthed, disable the trap + if (.capacity <= 0) { + setnpcdisplay strnpcinfo(0), NPC_TRAP; + .@t = htget($@_DUPES, .name$, 0); + if (.@t) { + .@t = min(gettimetick(2)+2, .@t); + htput($@_DUPES, .name$, .@t); + } + end; + } + // Retrieve parameters explode(.@parts$, strnpcinfo(0), "_"); .@gid=atoi(.@parts$[1]); .@dmg=atoi(.@parts$[2]); @@ -45,10 +56,12 @@ OnTouchNPC: if (.@id == .@gid) end; // Actual trap function + .capacity -= 1; SkillTrap(.@dmg, .@stn); end; OnInit: + .capacity = INT_MAX; // A small animation of the trap arming itself... sleep(500); setnpcdisplay strnpcinfo(0), NPC_TRAP_ONLINE; |