Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elseif ($gdata(NPC;Data,$letrem($remext(%tperson)))) {
- var %raw = $letrem($remext(%tperson))
- if ($data(%tperson,Stats,Friendly)) { var %gambits = $data(NPC;Data,%raw,Summon;Gambits) }
- else { var %gambits = $data(NPC;Data,%raw,Gambits) }
- :repeat;gambits
- var %w = 0
- ;This loop loops through the available attacks which have specific gambits: Gambits=<Attack1> <Attack2>
- while ($numtok(%gambits,32) != %w) {
- dll WhileFix.dll WhileFix
- inc %w
- var %ability = $gettok($gettok(%gambits,%w,32),1,47)
- var %gambit = $data(NPC;Data,%raw,%ability)
- var %self. [ $+ [ %gambit ] ] $gettok($gettok(%gambits,%w,32),2,47)
- if (%self. [ $+ [ %gambit ] ]) { var %target = %tperson }
- else {
- if ($data(%tperson,Stats,Friendly)) { var %target = $randtarget(friendly,$1) }
- else { var %target = $randtarget(Normal,$1) }
- }
- ;bmsg %chan %tperson %target %gambit %ability
- ;----------------------------------------------------
- if ($gambitchk(%tperson,%target,%gambit,%ability,$1)) {
- var %data = $v1
- var %target = $gettok(%data,1,32)
- var %ability = $gettok(%data,2,32)
- var %ATB = $data(Abilities,%ability,ATB)
- var %CUR;ATB = $data(%tperson,Stats,ATB;Gauge)
- ;bmsg %chan ya %ability %CUR;ATB >= %ATB
- var %priority = 1
- ;This statement checks to see if %tpersons still has ATB segments available to use for an attack
- if (%CUR;ATB >= %ATB) {
- ;Unsets %priority if the target has more than 1 ATB gauge so the leftovers can be used to fill regular actions
- ;because if in fact %tperson only has 1 ATB gauge, it wont goto normal period.
- unset %priority
- action %target %tperson %ability - $1
- decini %tperson Stats ATB;Gauge %ATB
- goto repeat;gambits
- }
- elseif (%CUR;ATB < %ATB) { var %priority = 1 | break }
- elseif (%CUR;ATB == 0) { var %priority = 1 }
- ;Not done
- }
- ;----------------------------------------------------
- elseif (%w == $numtok(%gambits,32)) {
- ;The !%priority applies to npcs whose gambits did not succeed in possible scenario succession <- O_O
- if ($data(%tperson,Stats,ATB;Gauge) >= 1) || (!%priority) { goto normal }
- }
- }
- ;end of gambit loop
- if (!%priority) {
- :normal
- var %CUR;ATB = $data(%tperson,Stats,ATB;Gauge)
- var %m = 0
- var %success = 200
- :once;again
- if ($data(%tperson,Stats,Friendly)) { var %target = $randtarget(friendly,$1) }
- else { var %target = $randtarget(Normal,$1) }
- if ($data(%battle,Data,Guardian) && $data(%battle,Status,$+(Guardian:,$v1)) == 1) { var %target = $data(%battle,Data,Guardian) }
- var %abilities = $data(NPC;Data,%raw,Abilities)
- var %x = 0
- while ($numtok(%abilities,32) != %x) {
- dll WhileFix.dll WhileFix
- inc %x
- var %chance = $rand(1,100)
- ;Format: Haste/self:30 or Haste:30, just gettok,s the first so it can check for ossible self targetting down there v
- var %ability = $gettok($gettok($gettok(%abilities,%x,32),1,58),1,47)
- var %self = $gettok($gettok($gettok(%abilities,%x,32),1,58),2,47)
- if (%self) { var %target = %tperson | unset %self }
- var %ATB = $data(Abilities,%ability,ATB)
- var %percent = $gettok($gettok(%abilities,%x,32),2,58)
- if (!%percent) { var %percent = 100 }
- bmsg %chan %chance %percent for %ability %self
- if (%chance <= %percent) {
- if ($data(NPC;Data,%raw,%ability)) {
- var %gambit = $v1
- if (!$gambitchk(%tperson,%target,%gambit,%ability,$1)) { goto once;again }
- }
- ;Different action for more than 1 ATB gauge
- if ($data(%tperson,Readying,Eidolon)) {
- uini %tperson Readying Eidolon
- .timeraction. [ $+ [ %battle ] ] -m 1 500 %msg $name(%tperson) readies to strike!
- .timeraction2. [ $+ [ %battle ] ] -m 1 600 turn $1
- goto cease
- }
- if ($data(%tperson,Stats,Max;ATB;Gauge) > 1) {
- if (%CUR;ATB >= %ATB) && (%target) {
- if (%tperson == Brynhildr) {
- if ($istok($data(%tperson,Stats,Status),Enfrost,32) == $true) { var %ability = $replace(%ability,Pyro,Cryo) }
- if ($istok($data(%tperson,Stats,Status),Enthunder,32) == $true) { var %ability = $replace(%ability,Pyro,Electro) }
- if ($istok($data(%tperson,Stats,Status),Enwater,32) == $true) { var %ability = $replace(%ability,Pyro,Hydro) }
- }
- ;.timeraction. [ $+ [ %battle ] $+ ] . [ $+ [ %success ] ] -m 1 %success action %target %tperson %ability - $1
- action %target %tperson %ability - $1
- inc %success 150
- decini %tperson Stats ATB;Gauge %ATB
- var %CUR;ATB = $data(%tperson,Stats,ATB;Gauge)
- if (%CUR;ATB > 0) { goto once;again }
- else { goto finished }
- }
- else {
- inc %m
- if (%m >= 5) {
- :finished
- .timeraction2. [ $+ [ %battle ] ] -m 1 1000 eventchk $1 $iif(%gestalt. [ $+ [ %battle ] ],$data(%battle,Eidolon,Summoner),$null)
- .timeraction3. [ $+ [ %battle ] ] -m 1 1000 swini %tperson Stats ATB;Gauge $data(%tperson,Stats,Max;ATB;Gauge)
- if ($istok(Odin Stiria Nix Brynhildr Bahamut Alexander Hecatoncheir,$remext(%tperson),32) == $true) { swini %tperson Readying Eidolon 1 }
- goto cease
- }
- goto once;again
- }
- }
- ;Generic map for max ATB Gauge of 1
- else { break }
- }
- }
- }
- if ($data(%tperson,Readying,Wait)) {
- var %data = $data(%tperson,Readying,Data)
- var %target = $gettok(%data,2,32)
- var %ability = $gettok(%data,1,32)
- decini %tperson Readying Wait 1
- if ($data(%tperson,Readying,Wait) <= 0) { goto execute }
- else {
- .timeraction3. [ $+ [ %battle ] ] -m 1 500 %msg $name(%tperson) readies $acol(%ability) $+ !
- .timeraction4. [ $+ [ %battle ] ] -m 1 650 turn $1
- swini %tperson Stats ATB;Gauge $data(%tperson,Stats,Max;ATB;Gauge)
- halt
- }
- }
- elseif (%ATB > $data(%tperson,Stats,Max;ATB;Gauge)) {
- swini %tperson Readying Data %ability %target
- swini %tperson Readying Wait $calc(%ATB - 1)
- if ($istok($alive(All,$1),%target,32) != $true) { var %target = $randtarget(Normal,$1) }
- .timeraction3. [ $+ [ %battle ] ] -m 1 500 %msg $name(%tperson) readies $acol(%ability) $+ !
- .timeraction4. [ $+ [ %battle ] ] -m 1 550 swini %tperson Stats ATB;Gauge $data(%tperson,Stats,Max;ATB;Gauge)
- .timeraction5. [ $+ [ %battle ] ] -m 1 600 turn $1
- halt
- }
- else {
- :execute
- .timeraction. [ $+ [ %battle ] ] -m 1 500 action %target %tperson %ability - $1
- .timeraction2. [ $+ [ %battle ] ] -m 1 650 eventchk $1 $iif(%gestalt. [ $+ [ %battle ] ],$data(%battle,Eidolon,Summoner),$null)
- swini %tperson Stats ATB;Gauge $data(%tperson,Stats,Max;ATB;Gauge)
- }
- }
- ;end of npc attacking phase
- }
Add Comment
Please, Sign In to add comment