Jump to content

Patskie

Members
  • Posts

    1702
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Patskie

  1. It should work fine if your timer was attached to a player
  2. //===== rAthena Script ======================================= //= Battleground: Emperium //===== Description: ========================================= //= A simple battleground script: //= Destroy the opponent's Emperium to win the match. //===== Changelogs: ========================================== //= 1.0 First version, edited. [Euphy] [AnnieRuru] //= 1.1 Use up to date battleground script commands [AnnieRuru] //= 1.2 Fix player can be kill multiple times within 250ms time frame [AnnieRuru] //============================================================ - script bg_emp#control -1,{ OnInit: .minplayer2start = 5; // minimum players to start (ex. if 3vs3, set to 3) .eventlasting = 20*60; // event duration before auto-reset (20 minutes * seconds) setarray .rewarditem[0], // rewards for the winning team: <item>,<amount>,... 7829, 30; end; OnStart: if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end; // create Battleground and teams .red = waitingroom2bg( "-", 0,0, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ ); .blue = waitingroom2bg( "-", 0,0, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ ); delwaitingroom .rednpcname$; delwaitingroom .bluenpcname$; setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red"; setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue"; bg_warp .red, "bat_a01", 171,346; bg_warp .blue, "bat_a01", 162,50; // delay before match begins sleep 6000; mapannounce "bat_a01", "The rules are simple. The first team to break the opponent's Emperium wins!", bc_map; sleep 3000; for ( .@i = 5; .@i > 0; --.@i ) { mapannounce "bat_a01", "["+ .@i +"]", bc_map; sleep 1000; } mapannounce "bat_a01", "Start!", bc_map; // spawn Emperiums bg_monster .red,"bat_a01",171,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown"; bg_monster .blue,"bat_a01",162,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown"; delwall "bg_emp_town_red"; delwall "bg_emp_town_blue"; // match duration sleep .eventlasting * 1000; // end match, destroy Battleground, reset NPCs killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown"; killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown"; if ( .winside ) { mapannounce "bat_a01", "- "+( (.winside == .red)? "Red" : "Blue" )+" Team is victorious! -", bc_map; bg_get_data .winside, 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem .rewarditem[0], .rewarditem[1], $@arenamembers[.@i]; bg_get_data .loseside, 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem 7829, 15, $@arenamembers[.@i]; } else mapannounce "bat_a01", "- The match has ended in a draw! -", bc_map; sleep 5000; bg_warp .red, "prontera", 155,182; bg_warp .blue, "prontera", 158,182; bg_destroy .red; bg_destroy .blue; .winside = 0; donpcevent .rednpcname$ +"::OnStart"; donpcevent .bluenpcname$ +"::OnStart"; end; // Emperium destroyed OnRedDown: callsub L_EmpDown, "Red", .blue; OnBlueDown: callsub L_EmpDown, "Blue", .red; L_EmpDown: mapannounce "bat_a01", strcharinfo(0) +" has destroyed "+ getarg(0) +" Team's Emperium.", bc_map; .winside = getarg(1); .loseside = .winside == .red ? .blue : .red; awake strnpcinfo(0); end; // "OnDeath" event OnRedDead: callsub L_Dead, 157,347; OnBlueDead: callsub L_Dead, 142,51; L_Dead: warp "bat_a01", getarg(0), getarg(1); percentheal 100,100; end; // "OnQuit" event OnRedQuit: callsub L_Quit, .red, "Red"; OnBlueQuit: callsub L_Quit, .blue, "Blue"; L_Quit: percentheal 100, 100; if ( !bg_get_data( getarg(0), 0 ) ) mapannounce "bat_a01", "All "+ getarg(1) +" team members have quit!", bc_map, 0xff3333; end; } bat_room,138,136,6 script Red Team#bg_emp 413,{ end; OnInit: sleep 1; set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0); OnStart: waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" ); end; } bat_room,144,136,4 script Blue Team#bg_emp 417,{ end; OnInit: sleep 1; set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0); OnStart: waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" ); end; } bat_room,141,135,6 script BG EMP 858,{ mes "BG EMP 5 VS 5"; mes "Premio Equipo Ganador:"; mes "30 <ITEM>Valor Badge<INFO>7828</INFO></ITEM>"; mes "Premio Equipo Perdedor:"; mes "15 <ITEM>Valor Badge<INFO>7828</INFO></ITEM>"; end; } bat_a01 mapflag battleground bat_a01 mapflag nosave SavePoint bat_a01 mapflag nowarp bat_a01 mapflag nowarpto bat_a01 mapflag noteleport bat_a01 mapflag nomemo bat_a01 mapflag nopenalty bat_a01 mapflag nobranch bat_a01 mapflag noicewall bat_a01 mapflag hidemobhpbar
  3. Try below prontera,150,150,6 script Gold Room Warper 100,{ warp "ordeal_3-1", 149, 149; end; OnPCDieEvent: if (strcharinfo(3) != "ordeal_3-1" || !countitem(.item) || killerrid == getcharid(3)) end; getmapxy .@map$, .@x, .@y; .@i = countitem(.item) / 10; if (!.@i) end; delitem .item, .@i; makeitem .item, .@i, .@map$, .@x, .@y; end; OnInit: .item = 969; // Gold end; } ordeal_3-1,0,0 monster Dokebi 1110,50,5000
  4. You can only use integer values when creating scripts so you have to adjust your rand() to achieve 0.5% chance if (rand(1000) < 5) means 0.5% if (rand(1000) < 1) means 0.1% if (rand(1000) < 10) means 1%
  5. If you have a trigger point then it should work fine. (i.e OnPCLoginEvent, OnPCLogoutEvent, bindatcmd, etc.)
  6. What are you updating in the database? If you are updating by providing DML (insert,update,delete) statements then there's no need to restart rAthena
  7. prontera,150,150,6 script Test 100,{ for (.@i = 50; .@i <= 60; .@i++) { playBGM "" + .@i; sleep2 3000; } end; }
  8. Change if (getequiprefinerycnt(.@part) >= 7) announce "[Hollgrehenn]: "+strcharinfo(0)+" has successfully refined "+getequipname(.@part)+" to +"+getequiprefinerycnt(.@part)+"!",0; To switch (getiteminfo(getequipid(.@part), 13)) { case 1: .@asd = 9; break; case 2: .@asd = 8; break; case 3: .@asd = 6; break; case 4: .@asd = 5; break; default: break; } if (getequiprefinerycnt(.@part) >= .@asd) announce "[Hollgrehenn]: "+strcharinfo(0)+" has successfully refined "+getequipname(.@part)+" to +"+getequiprefinerycnt(.@part)+"!",0;
  9. This can be exploited if you do a suicide mission (paladin casting grand cross for instance) @Mizore Change if ( rand(100) <= .chance ) { to if ( rand(100) <= .chance && killedrid != getcharid(3) ) {
  10. *guildgetexp <amount>; This will give the specified amount of guild experience points to the guild the invoking character belongs to. It will silently fail if they do not belong to any guild.
  11. You can give an event npc of yours so we can give some sort of pseudo code on how to achieve your request.
  12. Can elaborate more what you want with these commands so people can help you
  13. https://rathena.org/board/topic/78839-item-crafter-npc/?do=findComment&comment=191819
  14. Change set .i1rand,rand(getarraysize(.i1)); to set .i1rand,getarraysize(.i1); Change // Common Items else { getitem .i1[.i1rand],1; end; } to // Common Items else { while (.@i < .i1rand) { getitem .i1[.@i],1; .@i++; } end; }
  15. OnPCDieEvent: if (@die % 2) end; warp "SavePoint", 0, 0; @die++; end;
  16. You can check @Emistry post here https://rathena.org/board/topic/62590-ygg-room-and-ygg-ticket/?do=findComment&comment=97337
  17. Would that 5 hours mean accumulative regardless if they go offline or not?
  18. Change Job_Options(.@job_opt,Job_Swordman, Job_Mage, Job_Archer, Job_Acolyte, Job_Merchant, Job_Thief, Job_Super_Novice, Job_Taekwon, Job_Gunslinger, Job_Ninja); To Job_Options(.@job_opt,Job_Swordman, Job_Mage, Job_Archer, Job_Acolyte, Job_Merchant, Job_Thief);
  19. You can check my comment here
  20. It should not harm you at the moment. So it can be ignored "for now". But if you want to really get rid of the warnings then you need to change all INT(11) to INT
  21. https://rathena.org/board/files/file/3736-another-freebies-npc-with-easy-characc-bound-settings/
  22. Your script will already check if the invoking player is in party or not if (getcharid(1) == 0){ mes "^ff0000To enter, you must create or join a party of 1 or more members.^000000"; close; } *getcharid(<type>{,"<character name>"}) This function will return a unique ID number of the invoking character, or, if a character name is specified, of that player. Type is the kind of associated ID number required: 0 - Character ID 1 - Party ID 2 - Guild ID 3 - Account ID 4 - Battle Ground ID 5 - Clan ID
  23. You could try below prontera,150,150,6 script Gold Room Manager 2_M_OLDBLSMITH,{ function CheckRoom; .@guild = getcharid(2); if (!.@guild) { mes .npc$; mes "You are not in guild"; close; } if (strcharinfo(0) != getguildmaster(.@guild)) { mes .npc$; mes "Only guild leader can talk to me"; close; } if (Zeny < .zeny) { mes .npc$; mes "You need " + (callfunc ("F_InsertComma", .zeny)) + " zeny in order to rent a room."; close; } mes .npc$; mes "Which map do you want to rent?"; next; while (.@i < .size) { if (CheckRoom(.@i) && getd(".Room"+.@i) == getcharid(2)) .@owned++; .@menu$ += .Maps$[.@i] + " - [" + (CheckRoom(.@i) ? "Unavailable" : "Available") + "]:"; .@i++; } .@s = select(.@menu$) - 1; if (CheckRoom(.@s)) { mes .npc$; mes "I told you it's unavailable!"; close; } if (.@owned) { mes .npc$; mes "You already owned a room! Make room for others!"; close; } mes .npc$; mes "Are you sure you want to rent " + .Maps$[.@s] + "?"; next; if (select("Yes:No") - 1) end; Zeny -= .zeny; setd ".Room"+.@s, .@guild; announce "Guild " + getguildname(.@guild) + " has occupied gold room " + .Maps$[.@s], 0; close; // true = occupied | false = available function CheckRoom { .@rn = getarg(0, 0); return getd(".Room"+.@rn) ? true : false; } // Release rooms every 2 hours OnMinute00: if (gettime(DT_HOUR) % 2) end; while (.@i < .size) { setd ".Room"+.@i, 0; .@i++; } announce "Gold rooms are now available again for rent!", 0; end; OnGuildRoom: if (!getcharid(2)) end; while (.@i < .size) { if (getd(".Room"+.@i) == getcharid(2)) { warp .Maps$[.@i], 0, 0; break; } .@i++; } end; OnInit: .npc$ = "[" + strnpcinfo(1) + "]"; setarray .Maps$[0], "ordeal_3-1", "ordeal_3-2"; .size = getarraysize(.Maps$); while (.@i < .size) { setmapflag .Maps$[.@i], MF_NOWARPTO; .@i++; } .zeny = 5000; bindatcmd "guildroom", strnpcinfo(1) + "::OnGuildRoom"; end; } - script GRBuff FAKE_NPC,{ if (@delay > gettimetick(2)) { emotion ET_ANGER; npctalk "Use me after " + (@delay - gettimetick(2)) + " second(s)."; } else { specialeffect2 EF_HEAL2; percentheal 100,100; specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; @delay = gettimetick(2) + 3; // 3 seconds delay } end; } // Add more npc on every room ordeal_3-1,149,149,6 duplicate(GRBuff) Kiddo#ord31 4W_KID ordeal_3-2,153,153,6 duplicate(GRBuff) Kiddo#ord32 4W_KID // Monsters ordeal_3-1,0,0 monster Dokebi 1110,50,5000 ordeal_3-2,0,0 monster Dokebi 1110,50,5000
  24. 12218,Assumptio_5_Scroll,LV5 Assumptio Scroll,2,2,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_ASSUMPTIO,100000,5; skilleffect "HP_ASSUMPTIO",0; },{},{} Like this?
  25. https://rathena.org/board/topic/76694-stolaos-daily-login-reward-v20b/
×
×
  • Create New...