Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== rAthena Script =======================================
- //= At Command
- //===== By: ==================================================
- //= Sehrentos
- //===== Current Version: =====================================
- //= 1.0
- //===== Compatible With: =====================================
- //= rAthena Project
- //===== Description: =========================================
- //= Custom summon command: Army of the Baphomet
- //= @minions <Number> - 0)disable 1)Enable 2)Stats
- //===== Additional Comments: =================================
- //= 1.0 Initial script.
- //============================================================
- - script #atcmd_aotb -1,{
- OnInit:
- .delay = 3 * 60; // Seconds
- .update = 2 * (60 * 1000); // Miliseconds (120000=2-min)
- .amount = 5; // Note: below 5, you must edit buffs
- bindatcmd "minions", strnpcinfo(3)+"::OnAtMinions";
- end;
- OnAtMinions:
- if ( .@atcmd_numparameters != 1 ) {
- message strcharinfo(0), "Usage: "+ .@atcmd_command$ +" <1=On / 0=Off / 2=Stats>";
- end;
- }
- .@param = atoi( .@atcmd_parameters$[0] );
- if ( .@param == 1 ) {
- callsub S_Start;
- } else if ( .@param == 2 ) {
- callsub S_Stats;
- } else {
- callsub S_Stop;
- }
- end;
- OnMinionDeath:
- end;
- OnTimer:
- if (!playerattached()) end;
- callsub S_Update;
- showscript "Updated ( "+ getarraysize(@aotb_gid) +" ) minions attributes.", getcharid(3), SELF;
- addtimer .update, strnpcinfo(3) + "::OnTimer"; // 60000(1 minute)
- end;
- // callsub S_Stop; Remove all minions and stop timers
- S_Stop:
- .@size = getarraysize(@aotb_gid);
- if (!.@size) end;
- message strcharinfo(0), "Army of the Baphomet stopped.";
- for ( .@i = 0; .@i < .@size; .@i++ ) {
- if (unitexists(@aotb_gid[.@i])) unitkill(@aotb_gid[.@i]);
- }
- deletearray @aotb_gid[0], .@size;
- @aotb_active = 0;
- deltimer strnpcinfo(3)+"::OnTimer";
- awake strnpcinfo(3);
- return;
- // callsub S_Start; Summon all minion's
- S_Start:
- if (@aotb_active) {
- message strcharinfo(0), "Army of the Baphomet is already active.";
- end;
- }
- if (gettimetick(2) < @aotb_delay) {
- message strcharinfo(0), "Army of the Baphomet is on cooldown ("+ (@aotb_delay - gettimetick(2)) +" seconds).";
- end;
- }
- @aotb_active = 1;
- @aotb_delay = gettimetick(2) + .delay;
- // Remove previous minions
- for ( .@i = 0; .@i < getarraysize(@aotb_gid); .@i++ ) {
- if (unitexists(@aotb_gid[.@i])) unitkill(@aotb_gid[.@i]);
- }
- deletearray @aotb_gid[0], getarraysize(@aotb_gid);
- // Summon new minions
- message strcharinfo(0), "Army of the Baphomet!";
- while (@aotb_active && Hp && getarraysize(@aotb_gid) < .amount) {
- getmapxy(.@map$, .@x, .@y, UNITTYPE_PC); // 0 = UNITTYPE_PC
- monster strcharinfo(3), rand(.@x, .@x-3), rand(.@y-3, .@y), "--ja--", 1101, 1, strnpcinfo(3)+"::OnMinionDeath";
- .@gid = $@mobid[0];
- setarray @aotb_gid[getarraysize(@aotb_gid)], .@gid;
- setunitdata .@gid, UMOB_MASTERAID, getcharid(3); // Master AID
- //setunitdata .@gid, UMOB_CLASS, 1101; // Class ID (4012)Sniper (With no skills)
- setunitdata .@gid, UMOB_SIZE, 0; // Size 0=Small, 1=Medium, 2=Large
- setunitdata .@gid, UMOB_LEVEL, BaseLevel - 1; // Level
- setunitdata .@gid, UMOB_MAXHP, BaseLevel * 1000; // Max HP (175lv = 175.000)
- setunitdata .@gid, UMOB_SPEED, 70; // Movement speed
- setunitdata .@gid, UMOB_CANMOVETICK, 80; // Move delay seconds * 1000
- setunitdata .@gid, UMOB_CRIT, 450; // Crit rate (1000=100%)
- setunitdata .@gid, UMOB_HIT, 500; // Hit rate (1000=100%)
- setunitdata .@gid, UMOB_MODE, 4089; // Mode (Can move, attack, assist, target weak)
- setunitdata .@gid, UMOB_DMGIMMUNE, 0; // Immune to damage
- setunitdata .@gid, UMOB_ATKRANGE, 1; // Attack range
- setunitdata .@gid, UMOB_RACE, 6; // Race (See doc/mob_db) 6=Demon
- setunitdata .@gid, UMOB_ELETYPE, 80; // Element (See doc/mob_db) 80=(4)Neutral 89=(4)Undead
- setunitdata .@gid, UMOB_ELELEVEL, 4; // Element level
- setunitdata .@gid, UMOB_AMOTION, 500; // Attack animation motion
- setunitdata .@gid, UMOB_ADELAY, 500; // Attack delay (ASPD)
- setunitdata .@gid, UMOB_DMOTION, 500; // Damage animation motion
- setunitdata .@gid, UMOB_ATKMIN, (readparam(bStr) + readparam(bDex)) * 4; // 125 x 5 = 625
- setunitdata .@gid, UMOB_ATKMAX, (readparam(bStr) + readparam(bDex)) * 30; // 125 x 60 = 7500
- setunitdata .@gid, UMOB_MATKMIN, (readparam(bInt) + readparam(bDex)) * 4; // 125 x 5 = 625
- setunitdata .@gid, UMOB_MATKMAX, (readparam(bInt) + readparam(bDex)) * 30; // 125 x 60 = 7500
- setunitdata .@gid, UMOB_DEF, readparam(bDef);
- setunitdata .@gid, UMOB_MDEF, readparam(bMdef);
- setunitdata .@gid, UMOB_FLEE, readparam(bFlee);
- setunitdata .@gid, UMOB_PDODGE, readparam(bFlee2);
- setunitdata .@gid, UMOB_STR, readparam(bStr);
- setunitdata .@gid, UMOB_AGI, readparam(bAgi);
- setunitdata .@gid, UMOB_VIT, readparam(bVit);
- setunitdata .@gid, UMOB_INT, readparam(bInt);
- setunitdata .@gid, UMOB_DEX, readparam(bDex);
- setunitdata .@gid, UMOB_LUK, readparam(bLuk);
- setunitname .@gid, strcharinfo(0)+"'s minion";
- //unittalk .@gid, "Murlr mrul!!", bc_self;
- //specialeffect2 EF_FIRESPLASHHIT;
- // Buff minion
- //unitskilluseid .@gid,157,1; // MG_ENERGYCOAT on the minion 300000(5-min) duration
- // Buff player. Each minion give different buffs
- switch(getarraysize(@aotb_gid)) {
- case 1: unitskilluseid .@gid,29,10,getcharid(3); break; // AL_INCAGI
- case 2: unitskilluseid .@gid,33,10,getcharid(3); break; // AL_ANGELUS
- case 3: unitskilluseid .@gid,34,10,getcharid(3); break; // AL_BLESSING
- case 4: unitskilluseid .@gid,73,10,getcharid(3); break; // PR_KYRIE
- case 5: unitskilluseid .@gid,113,10,getcharid(3); break; // BS_OVERTHRUST
- default: break;
- }
- deltimer strnpcinfo(3)+"::OnTimer";
- addtimer .update, strnpcinfo(3)+"::OnTimer";
- //message strcharinfo(0), "( "+ getarraysize(@aotb_gid) +" ) minions released !!";
- showscript "( "+ getarraysize(@aotb_gid) +" ) minions released!!", getcharid(3), SELF;
- sleep2 1500;
- }
- @aotb_active = 0;
- //message strcharinfo(0), "Army of the Baphomet is complete.";
- return;
- // callsub S_Stats; Print minion's status
- S_Stats:
- if (!getarraysize(@aotb_gid)) end;
- .@player$ = strcharinfo(0);
- for ( .@i = 0; .@i < getarraysize(@aotb_gid); .@i++ ) {
- if (unitexists(@aotb_gid[.@i])) {
- getunitdata(@aotb_gid[.@i], .@unit);
- message .@player$, "Minion "+ (.@i + 1) +": " + getunitname(@aotb_gid[.@i]) +"("+ .@unit[UMOB_CLASS] +")";
- message .@player$, "Lv:" + .@unit[UMOB_LEVEL] + " HP:" + .@unit[UMOB_HP] +"/"+ .@unit[UMOB_MAXHP];
- message .@player$, "Str:" + .@unit[UMOB_STR] + " Agi:" + .@unit[UMOB_AGI] + " Vit:" + .@unit[UMOB_VIT] + " Int:" + .@unit[UMOB_INT] + " Dex:" + .@unit[UMOB_DEX] + " Luk:" + .@unit[UMOB_LUK];
- message .@player$, "Atk:" + .@unit[UMOB_ATKMIN] +"/"+ .@unit[UMOB_ATKMAX] + " Matk:" + .@unit[UMOB_MATKMIN] +"/"+ .@unit[UMOB_MATKMAX];
- //message .@player$, "Current target:" + .@unit[UMOB_TARGETID];
- }
- }
- return;
- // callsub S_Update; Update all minion's stats and buffs
- S_Update:
- .@size = getarraysize(@aotb_gid);
- if (!.@size) end;
- for ( .@i = 0; .@i < .@size; .@i++ ) {
- if (!Hp) end;
- if (unitexists(@aotb_gid[.@i])) {
- setunitdata @aotb_gid[.@i], UMOB_LEVEL, BaseLevel - 1;
- setunitdata @aotb_gid[.@i], UMOB_MAXHP, BaseLevel * 1000;
- setunitdata @aotb_gid[.@i], UMOB_ATKMIN, (readparam(bStr) + readparam(bDex)) * 4;
- setunitdata @aotb_gid[.@i], UMOB_ATKMAX, (readparam(bStr) + readparam(bDex)) * 30;
- setunitdata @aotb_gid[.@i], UMOB_MATKMIN, (readparam(bInt) + readparam(bDex)) * 4;
- setunitdata @aotb_gid[.@i], UMOB_MATKMAX, (readparam(bInt) + readparam(bDex)) * 30;
- setunitdata @aotb_gid[.@i], UMOB_DEF, readparam(bDef);
- setunitdata @aotb_gid[.@i], UMOB_MDEF, readparam(bMdef);
- setunitdata @aotb_gid[.@i], UMOB_FLEE, readparam(bFlee);
- setunitdata @aotb_gid[.@i], UMOB_PDODGE, readparam(bFlee2);
- setunitdata @aotb_gid[.@i], UMOB_STR, readparam(bStr);
- setunitdata @aotb_gid[.@i], UMOB_AGI, readparam(bAgi);
- setunitdata @aotb_gid[.@i], UMOB_VIT, readparam(bVit);
- setunitdata @aotb_gid[.@i], UMOB_INT, readparam(bInt);
- setunitdata @aotb_gid[.@i], UMOB_DEX, readparam(bDex);
- setunitdata @aotb_gid[.@i], UMOB_LUK, readparam(bLuk);
- // Buff minion
- //unitskilluseid @aotb_gid[.@i],157,1; // MG_ENERGYCOAT 300000(5-min) duration
- // Buff player. Each minion give different buffs
- switch(.@i) {
- case 0: unitskilluseid @aotb_gid[.@i],29,10,getcharid(3); break; // AL_INCAGI
- case 1: unitskilluseid @aotb_gid[.@i],33,10,getcharid(3); break; // AL_ANGELUS
- case 2: unitskilluseid @aotb_gid[.@i],34,10,getcharid(3); break; // AL_BLESSING
- case 3: unitskilluseid @aotb_gid[.@i],73,10,getcharid(3); break; // PR_KYRIE
- case 4: unitskilluseid @aotb_gid[.@i],113,10,getcharid(3); break; // BS_OVERTHRUST
- default: break;
- }
- sleep2 1500;
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement