-
Posts
1702 -
Joined
-
Last visited
-
Days Won
19
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Patskie
-
It should work fine if your timer was attached to a player
-
Annieruru bg_emp reward for loosing team request
Patskie replied to iraciz's question in Scripting Support
//===== 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 -
R> Gold room when player die inside gold room 10% of gold loot will dropped
Patskie replied to hadji22's question in Script Requests
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 -
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%
-
If you have a trigger point then it should work fine. (i.e OnPCLoginEvent, OnPCLogoutEvent, bindatcmd, etc.)
-
how to update database without closing server
Patskie replied to mansanalchamp's question in Database Support
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 -
prontera,150,150,6 script Test 100,{ for (.@i = 50; .@i <= 60; .@i++) { playBGM "" + .@i; sleep2 3000; } end; }
-
Smart Refine Announcement when exceed on safe limit
Patskie replied to Eross's question in Scripting Support
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; -
PvP Player gets drops by killing others in a specific map
Patskie replied to Mizore's question in Scripting Support
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) ) { -
*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.
-
You can give an event npc of yours so we can give some sort of pseudo code on how to achieve your request.
-
(Request) Costum Commands @Mall @quest @Dona etc...
Patskie replied to enfokan2rd's question in Script Requests
Can elaborate more what you want with these commands so people can help you -
R>Quest Item NPC success chance if failed delete requirements
Patskie replied to BugSICK's question in Script Requests
https://rathena.org/board/topic/78839-item-crafter-npc/?do=findComment&comment=191819 -
buildin_getitem: NonExistant item 0 requested
Patskie replied to Musika6988's question in Scripting Support
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; } -
Character return to save point after 2 deaths
Patskie replied to fireicesurfer's question in Script Requests
OnPCDieEvent: if (@die % 2) end; warp "SavePoint", 0, 0; @die++; end; -
You can check @Emistry post here https://rathena.org/board/topic/62590-ygg-room-and-ygg-ticket/?do=findComment&comment=97337
-
Would that 5 hours mean accumulative regardless if they go offline or not?
-
How to disable super Novice, gunslinger, taekwondo, ninja?
Patskie replied to fireicesurfer's question in Scripting Support
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); -
You can check my comment here
-
MySQL Workbench Ragnarok main_db warnings
Patskie replied to Kochalate's question in Database Support
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 -
https://rathena.org/board/files/file/3736-another-freebies-npc-with-easy-characc-bound-settings/
-
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
-
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
-
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?
-
https://rathena.org/board/topic/76694-stolaos-daily-login-reward-v20b/