Jump to content

Patskie

Forum Moderator
  • Posts

    1,694
  • Joined

  • Last visited

  • Days Won

    12

Community Answers

  1. Patskie's post in Unequip some equipment when enter on certain map was marked as the answer   
    - script cvc -1,{ OnPCLoadMapEvent: while (strcharinfo(3) == "guild_vs1") { if (getequipid(EQI_GARMENT) > 0) unequip EQI_GARMENT; if (getequipid(EQI_ARMOR) > 0) unequip EQI_ARMOR; sleep2 2000; } end; } guild_vs1 mapflag loadevent  
  2. Patskie's post in Fountain-esque, need some tips or advice was marked as the answer   
    Try below script:
    payon,131,232,4 script Goddess Elia 624,{ OnTimer1600: callfunc "regen", 1; initnpctimer; end; OnInit: initnpctimer; end; } payon,128,232,4 script Bard Mikhael 647,{ OnTimer20000: callfunc "regen", 0; initnpctimer; end; OnInit: initnpctimer; end; } function script regen { [email protected] = getarg(0, 0); // 0 - low | 1 - high [email protected] = 20; [email protected] = [email protected] ? 1 : 8; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, strnpcinfo(1); specialeffect 514; specialeffect 796; specialeffect 800; [email protected] = getareaunits(BL_PC, [email protected]$, ([email protected] - ([email protected] + 3)), [email protected] - [email protected], ([email protected] + ([email protected] + 3)), [email protected] + [email protected], [email protected]); if ([email protected] > 0) { for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { if (attachrid([email protected][[email protected]])) { if (Hp && (Hp != MaxHp)) { specialeffect2 312; percentheal [email protected], [email protected]; } detachrid; } } } return; } Same result but I removed unnecessary executions
     
  3. Patskie's post in Party warper with map restrictions and online party member display was marked as the answer   
    Try this
    prontera,156,182,0 script Party Warper 100,{ [email protected] = getcharid(1); [email protected] = getcharid(0); [email protected]$ = strcharinfo(0); if ([email protected]) end; getpartymember [email protected], 0; getpartymember [email protected], 1; getpartymember [email protected], 2; for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) [email protected]$ = [email protected]$ + ([email protected]$ != [email protected]$[[email protected]] ? [email protected]$[[email protected]] : "") + ":"; [email protected] = select([email protected]$) - 1; [email protected]$ = [email protected]$[[email protected]]; if (isloggedin([email protected][[email protected]], [email protected][[email protected]])) { getmapxy [email protected]$, [email protected], [email protected], BL_PC, [email protected]$; if (inarray(.restricted_map$, [email protected]$) != -1) message [email protected]$,"This is a restricted map."; else warp [email protected]$, [email protected], [email protected], [email protected]; } else message [email protected]$, [email protected]$ + " is not online."; end; OnInit: setarray .restricted_map$[0], "payon", "geffen"; end; }  
  4. Patskie's post in Give item to specific account id npc was marked as the answer   
    prontera,150,150,6 script Sample 100,{ [email protected] = getcharid(3); [email protected] = [email protected] > 2000000 && [email protected] < 2000101 && !#OBTFreebies; if ([email protected]) { getitem 501, 1; #OBTFreebies = 1; } end; }  
  5. Patskie's post in How to invoke an MvP in large size, by NPC? was marked as the answer   
    *monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>}; monster "prontera",150,150,"Big MvP",1832,1,strnpcinfo(3)+"::OnKill",Size_Large;  
  6. Patskie's post in hourly hour warning and debug was marked as the answer   
  7. Patskie's post in gettime or gettimestr was marked as the answer   
    query_sql ("INSERT INTO `redeembetalog` (`code`, `item_amount`,`name`, `time`) VALUES ('"+escape_sql(@voucher_code$)+"', '"[email protected]+"', '"+strcharinfo(0)+"', NOW())"); Store your data like above.
    Then whenever you pull the data, format them first before showing to the npc.
  8. Patskie's post in R> monster vs monster was marked as the answer   
    - script MVP_vs_MVP FAKE_NPC,{ OnMinute00: if (gettime(DT_HOUR) % 2 || .start) end; goto OnStart; end; OnStart: mapwarp "[email protected]", "prontera", 150, 150; killmonster "[email protected]", "All"; .start = 1; announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all; sleep 7000; announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all; sleep 7000; announce .npc$ + " We will start the event after 1 minute", bc_all; sleep 60000; announce .npc$ + " The entry to the event is now closed", bc_all; .start = 2; sleep 7000; if (getmapusers("[email protected]") < 1) { announce .npc$ + " Not enough participants to continue the event", 0; .start = 0; end; } mapannounce "[email protected]", .npc$ + " The rules for this event is simple", bc_map; sleep 7000; mapannounce "[email protected]", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map; sleep 7000; mapannounce "[email protected]", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map; sleep 7000; mapannounce "[email protected]", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map; sleep 7000; mapannounce "[email protected]", .npc$ + " All good?? Let's start betting !!!", bc_map; sleep 7000; mapannounce "[email protected]", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map; .start = 3; sleep 55000; mapannounce "[email protected]", .npc$ + " Betting will close in 5...", bc_map; sleep 1000; mapannounce "[email protected]", .npc$ + " 4...", bc_map; sleep 1000; mapannounce "[email protected]", .npc$ + " 3...", bc_map; sleep 1000; mapannounce "[email protected]", .npc$ + " 2...", bc_map; sleep 1000; mapannounce "[email protected]", .npc$ + " 1...", bc_map; sleep 1000; .start = 4; mapannounce "[email protected]", .npc$ + " Betting is now closed !!!", bc_map; sleep 7000; mapannounce "[email protected]", .npc$ + " Let's get ready to RUMBLE !!!", bc_map; [email protected] = .MVP[rand(.size)]; monster "[email protected]", 68, 68, "MVP A", [email protected], 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE; .ma = [email protected]; monster "[email protected]", 71, 68, "MVP B", [email protected], 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK; .mb = [email protected]; unitattack .ma, .mb; unitattack .mb, .ma; end; OnDie1: unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!"; sleep 7000; killmonster "[email protected]", "All"; .start = 0; addrid(5, 0, "[email protected]"); if (2 == @mvp_bet) { message strcharinfo(0),"Congratulations! You won the event, Good choice!"; Zeny += .bet_rewd; } @mvp_bet = 0; setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; warp "SavePoint", 0, 0; end; OnDie2: unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!"; sleep 7000; killmonster "[email protected]", "All"; .start = 0; addrid(5, 0, "[email protected]"); if (1 == @mvp_bet) { message strcharinfo(0),"Congratulations! You won the event, Good choice!"; Zeny += .bet_rewd; } @mvp_bet = 0; setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; warp "SavePoint", 0, 0; end; OnEventBet: mes .npc$; if (!.start) mes "The event is not active."; else if (.start != 3) mes "The event cannot accept bets at the moment."; else if (Zeny < .bet_cost) mes "You don't have enough zeny to make a bet."; else if (@mvp_bet) mes "You already placed your bet."; else if (strcharinfo(3) != "[email protected]") mes "Hmm~"; else { mes "Which mvp will you bet on this match???"; next; [email protected] = select("MVP A:MVP B"); mes .npc$; mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + ([email protected] == 1 ? "MVP A" : "MVP B") + "?"; next; if (select("Yes:No") & 2) end; if (.start != 3) { // in case they delay the select ??? setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; warp "SavePoint", 0, 0; end; } mes .npc$; mes "Good luck and have fun!"; Zeny -= .bet_cost; @mvp_bet = [email protected]; } end; OnEventJoin: if (!.start) message strcharinfo(0), "The event is not active."; else if (.start != 1) message strcharinfo(0), "The event is not yet allowing participants to enter."; else { setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true; switch (rand(1,4)) { case 1: warp "[email protected]", 49, 50; break; case 2: warp "[email protected]", 49, 88; break; case 3: warp "[email protected]", 89, 88; break; case 4: warp "[email protected]", 89, 50; break; } } end; OnInit: bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin"; bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet"; bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99; // List of MVP's setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159; .size = getarraysize(.MVP); .npc$ = "[MVP vs MVP Event]"; .bet_cost = 5000; // 5,000z to bet in the event .bet_rewd = 1000000; // 1,000,000z if bet wins end; } [email protected] mapflag monster_noteleport [email protected] mapflag noskill [email protected] mapflag noloot [email protected] mapflag noitemconsumption [email protected] mapflag nomemo [email protected] mapflag nosave SavePoint [email protected] mapflag nowarpto [email protected] mapflag nowarp [email protected] mapflag noteleport  
  9. Patskie's post in Error Npc Custom was marked as the answer   
    Change
    recovery; to
    recovery 0, getcharid(0), 4;  
  10. Patskie's post in How to disable normal attack if you are not equip specific item was marked as the answer   
    You can try to work with below command to get what you want
     
  11. Patskie's post in Jobchanger set script insertion was marked as the answer   
    After
    if ([email protected]_class != Class) { if (.Platinum) callfunc "F_GetPlatinumSkills"; if (.GetJobEquip) Get_Job_Equip(); } Add 
    set instantjobchange,1;  
  12. Patskie's post in NPC Registration was marked as the answer   
    Something like this?
    prontera,150,150,6 script Sample 100,{ if (BaseLevel < 20) end; switch (select("Register", "View List", (getgmlevel() < 99 ? "" : "[^FF0000GM Menu^000000] Clear List"), "Exit")) { case 1: if (inarray($register$, strcharinfo(0)) != -1) mes "Already registered"; else { mes "Done registration"; $register$[getarraysize($register$)] = strcharinfo(0); } close; case 2: [email protected] = getarraysize($register$); if ([email protected]) mes "No list"; else { mes "Registration List"; for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) mes ([email protected]+1) + ". " + $register$[[email protected]]; } close; case 3: deletearray $register$; end; } }  
  13. Patskie's post in 2 or more call function in random box was marked as the answer   
    17767,Advertisment_Box_Price,Advertisment Box Price,18,0,,1,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "CustomBox"; callfunc "CustomBox1"; },{},{}  
  14. Patskie's post in Help Making - 3 Number Lottery was marked as the answer   
    You can try below and let me know if it works for you
    prontera,130,215,5 script Lottery 76,{ function ShowNumbers; function GenerateNumbers; function MatchCount; function GenerateID; function GenerateID { $LWID = $LID; $LID = rand(100000, 999999); return; } function MatchCount { [email protected] = 0; for ([email protected] = 0; [email protected] < .combinations; [email protected]++) { if (inarray($LW, #LW[[email protected]]) != -1) [email protected]++; } return [email protected]; } function ShowNumbers { switch (getarg(0)) { default: case 0: [email protected]$ = "^FF0000"; [email protected]$ = "#LW"; break; case 1: [email protected]$ = "^0000FF"; [email protected]$ = "$LW"; break; case 2: [email protected]$ = "^006600"; [email protected]$ = "$LR"; break; } if (getarg(1, 0)) [email protected]$ = ""; [email protected]$ = [email protected]$; for ([email protected] = 0; [email protected] < .combinations; [email protected]++) [email protected]$ = [email protected]$ + "[" + getd([email protected]$+"["[email protected]+"]") + "] "; if (!getarg(1, 0)) [email protected]$ = [email protected]$ + "^000000"; return [email protected]$; } function GenerateNumbers { [email protected] = 0; deletearray getarg(0); while ([email protected] < .combinations) { do { [email protected] = rand(1, 40); } while (inarray(getarg(0), [email protected]) != -1); set getelementofarray(getarg(0), [email protected]), [email protected]; [email protected]++; } return; } mes .npc$; mes "Winning Lotto Numbers ("+$LWID+"):"; mes ShowNumbers(1, 0); mes "Your Ticket ("+#LID+"):"; mes ShowNumbers(0, 0); mes "Next Draw-ID: ^FF0000" + $LID + "^000000."; next; switch(select((#LID == $LWID ? "Claim Prize" : ""), "Buy New Ticket", (getgmlevel() < .gm_level ? "" : "^FF0000[GM]^000000 Do Draw Now"), (getgmlevel() < .gm_level ? "" : "^FF0000[GM]^000000 Rig the Lottery"), "Cancel")) { default: break; // Claim Prize case 1: [email protected]_count = MatchCount(); if ([email protected]_count != .combinations) { mes .npc$; mes "Bad luck, it appears you do not hold a winning ticket."; next; mes .npc$; mes "Better luck next time!."; close; } mes .npc$; mes "You have matched all " + .combinations + " numbers!"; mes "Jackpot!"; mes "You've won ^0000FF" + F_InsertComma(.jackpot_zeny) + "^000000z & " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!"; Zeny = (Zeny + .jackpot_zeny) > 2147483647 ? 2147483647 : (Zeny + .jackpot_zeny); getitem .jackpot_items[0], .jackpot_items[1]; announce "Lottery: " + strcharinfo(0) + " has won the JACKPOT of " + F_InsertComma(.jackpot_zeny) + "z & " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!", 0; #LID = 0; break; // Buy New Ticket case 2: if (#LW && #LID == $LID) { mes .npc$; mes "It appears that you already have a ticket for today."; mes "You may only purchase one ticket per draw."; close; } mes .npc$; mes "Tickets cost ^0000FF" + F_InsertComma(.ticket_price) + "^000000z."; mes "The Jackpot is ^FF0000" + F_InsertComma(.jackpot_zeny) + "^000000z & " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!"; next; if (Zeny < .ticket_price) { mes .npc$; mes "You can't afford a lottery ticket."; close; } mes .npc$; mes "Would you like your numbers hand picked or computer generated?"; next; switch(select("Computer Generated", "Hand Picked")) { case 1: while (true) { mes .npc$; mes "The computer has selected the following numbers:"; GenerateNumbers(#LW); mes ShowNumbers(0, 0); next; if (select("Re-Generate", "Confirm") & 2) break; } break; case 2: while (true) { mes .npc$; mes "Please pick your numbers (1-40):"; [email protected] = 0; [email protected] = 0; deletearray #LW; while ([email protected] < .combinations) { if (getarraysize(#LW)) { mes "PICK " + [email protected] + ": ^0000FF" + #LW[[email protected]] + "^000000"; [email protected]++; } do { input @pick; } while (@pick < 1 || @pick > 40 || inarray(#LW, @pick) != -1); #LW[getarraysize(#LW)] = @pick; [email protected]++; } mes "PICK " + [email protected] + ": ^0000FF" + #LW[[email protected]] + "^000000"; next; mes .npc$; mes "Your numbers are:"; mes ShowNumbers(0, 0); next; if (select("Confirm", "Re-Pick") == 1) break; } break; } Zeny -= .ticket_price; #LID = $LID; mes .npc$; mes "The live broadcasted draw is at 9pm."; mes "You can claim your ticket between then and the next draw."; next; mes .npc$; mes "Good luck!"; break; // Do Draw Now case 3: deletearray $LW; if (!$LR) GenerateNumbers($LW); else copyarray $LW, $LR, getarraysize($LR); close2; announce "Lottery: Welcome to the special GM's lotto draw!", 0; sleep 3000; announce "The numbers are as follows: " + ShowNumbers(1, 1), 0; sleep 3000; announce "Congratulations to the winners!", 0; GenerateID(); deletearray $LR; end; // Rig the Lottery case 4: while (true) { mes .npc$; mes "Please pick your numbers (1-40):"; [email protected] = 0; [email protected] = 0; deletearray $LR; while ([email protected] < .combinations) { if (getarraysize($LR)) { mes "PICK " + [email protected] + ": ^0000FF" + $LR[[email protected]] + "^000000"; [email protected]++; } do { input @pick; } while (@pick < 1 || @pick > 40 || inarray($LR, @pick) != -1); $LR[getarraysize($LR)] = @pick; [email protected]++; } mes "PICK " + [email protected] + ": ^0000FF" + $LR[[email protected]] + "^000000"; next; mes .npc$; mes "Your rigged numbers are:"; mes ShowNumbers(2, 0); next; if (select("Confirm", "Re-Pick") == 1) break; } mes .npc$; mes "Lottery rigged for next draw."; break; } close; // Automatic Draw OnClock0200: OnClock0400: OnClock0600: OnClock0800: OnClock1000: OnClock1200: OnClock1600: OnClock1800: OnClock2000: OnClock2006: OnClock2007: OnClock2200: deletearray $LW; if (!$LR) GenerateNumbers($LW); else copyarray $LW, $LR, getarraysize($LR); announce "Lottery: This hour's draw is worth " + F_InsertComma(.jackpot_zeny) + " Zeny and " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!!", 0; sleep 3000; announce "The numbers are as follows: " + ShowNumbers(1, 1), 0; sleep 3000; announce "Congratulations to the winners of tonight!", 0; GenerateID(); deletearray $LR; end; OnInit: .npc$ = "[Lottery]"; .gm_level = 99; .combinations = 3; .ticket_price = 100000; .jackpot_zeny = 2000000000; setarray .jackpot_items[0], 501, 20; if (!$LID) GenerateID(); waitingroom "Hourly Lottery",0; end; } You can set below configs as per your desire
    .gm_level .combinations .ticket_price .jackpot_zeny .jackpot_items  
  15. Patskie's post in Cash Points as payment for Card Seller? was marked as the answer   
    Change shop to cashshop
    - shop card_mob#A -1,501:1000 - shop card_mob#B -1,501:1000 - shop card_mob#C -1,501:1000 - shop card_mob#D -1,501:1000 - shop card_mob#E -1,501:1000 - shop card_mob#F -1,501:1000 - shop card_mob#G -1,501:1000 - shop card_mob#H -1,501:1000 - shop card_mob#I -1,501:1000 - shop card_mob#J -1,501:1000 - shop card_mob#K -1,501:1000 - shop card_mob#L -1,501:1000 - shop card_mob#M -1,501:1000 - shop card_mob#N -1,501:1000 - shop card_mob#O -1,501:1000 - shop card_mob#P -1,501:1000 - shop card_mob#Q -1,501:1000 - shop card_mob#R -1,501:1000 - shop card_mob#S -1,501:1000 - shop card_mob#T -1,501:1000 - shop card_mob#U -1,501:1000 - shop card_mob#V -1,501:1000 - shop card_mob#W -1,501:1000 - shop card_mob#X -1,501:1000 - shop card_mob#Y -1,501:1000 - shop card_mob#Z -1,501:1000  
  16. Patskie's post in SCRIPT DELAY STROM GUST, VERMILION, METEOR STROM PROBLEM was marked as the answer   
    If you are using latest rAthena then you can configure it in skill_db.yml. 
    Storm Gust : https://github.com/rathena/rathena/blob/5112f8e2d8a6eca1df88d1700de61f07e93de6f2/db/re/skill_db.yml#L3715
    LOV : https://github.com/rathena/rathena/blob/5112f8e2d8a6eca1df88d1700de61f07e93de6f2/db/re/skill_db.yml#L3381
    Meteor Storm : https://github.com/rathena/rathena/blob/5112f8e2d8a6eca1df88d1700de61f07e93de6f2/db/re/skill_db.yml#L3167
  17. Patskie's post in NPC getitem 1 per account every 4hours was marked as the answer   
    It's because you are using character variables
    You can replace wait_time to #wait_time
  18. Patskie's post in Gold Room how to make it 100% point was marked as the answer   
    Try below
    prontera,155,181,5 script Sample#goldroom 4_F_KAFRA1,{ doevent "gold_room_main::OnTalk"; } // warp portal back prontera ordeal_3-2,123,123,0 warp gold_room_back_prt 1,1,prontera,155,181 // peco peco summon ordeal_3-2,0,0,0,0 monster Peco Peco 1019,200,60000,0,"gold_room_main::OnKill" - script gold_room_main -1,{ OnInit: // gold room map .map$ = "ordeal_3-2"; // entrance fee .zeny_cost = 200000; // rate to get gold .rate = 100; // gold random amount setarray .gold_amount,1,5; setmapflag .map$,mf_noteleport; setmapflag .map$,mf_pvp; setmapflag .map$,mf_pvp_noguild; setmapflag .map$,mf_pvp_noparty; setmapflag .map$,mf_nobranch; setmapflag .map$,mf_nosave; setmapflag .map$,mf_nomemo; setmapflag .map$,mf_noreturn; setmapflag .map$,mf_nowarp; setmapflag .map$,mf_nowarpto; end; OnTalk: mes "Enter Gold Room ?"; if ( .zeny_cost ) mes F_InsertComma( .zeny_cost ) + " Zeny"; switch ( select( "Enter Gold Room", "Exchange Gold Point", "Cancel" )) { case 1: if ( Zeny < .zeny_cost ) { mes "Not enough Zeny."; } else { Zeny -= .zeny_cost; warp .map$,0,0; } break; case 2: mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points"; input [email protected],0,#GOLDPOINTS; if ( checkweight( 969, [email protected] ) ) { #GOLDPOINTS -= [email protected]; getitem 969,[email protected]; mes "Gained "[email protected]+" Gold."; } else { mes "You overweight."; } default: break; } close; OnKill: if ( .rate > rand( 100 ) ) { [email protected] = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "[email protected]+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; OnPCDieEvent: [email protected] = killerrid; if ( strcharinfo(3) == .map$ && [email protected] != getcharid(3) && getmonsterinfo( [email protected],MOB_NAME ) != "null" ) { #GOLDPOINTS = 0; dispbottom "You died, you lost all the point."; } end; }  
  19. Patskie's post in check if variable contains number was marked as the answer   
    prontera,150,150,6 script Sample 112,{ do { input [email protected]$; } while (callfunc("ValidateInput", [email protected]$)); mes "You pick " + [email protected]$; close; } function script ValidateInput { [email protected]$ = getarg(0, ""); [email protected] = getstrlen([email protected]$); for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { if (charat([email protected]$, [email protected]) != " ") { if (!charisalpha([email protected]$, [email protected])) return 1; } } return 0; }  
  20. Patskie's post in R> Zeny Roulette NPC using Cutin. was marked as the answer   
    Try below
    prontera,150,150,6 script Zeny Roulette 4_F_KAFRA1,{ function Roll; cutin "1s_1", 3; mes .npc$; mes "Hi " + strcharinfo(0) + ", So do you want to play zeny roulette?"; next; if (select("~ Yes:~ No") & 2) { mes .npc$; mes "Alright!"; close2; cutin "", 255; end; } mes .npc$; mes "Let's go!"; next; @level = 1; while(1) { switch(select("~ Play:~ Exit")) { case 1: [email protected]$ = Roll(@level); if ([email protected]$ == "NZ") { mes .npc$; mes "You need " + callfunc("F_InsertComma", .zeny_amt_need) + " in order to participate in the roulette."; [email protected] = 1; break; } if ([email protected]$ == "NA") { mes .npc$; mes "Seems not your lucky day " + strcharinfo(0); if (@level > 1) @level--; next; break; } [email protected] = inarray(.item_cutin$, [email protected]$); mes .npc$; mes "Congratulations! You won ^FF8000" + getitemname(.item_reward[[email protected]]) + "^000000!"; getitem .item_reward[[email protected]], 1; specialeffect 10; // Jackpot if ([email protected]$ == "7s_2") { announce strcharinfo(0) + " just won the jackpot prize " + getitemname(.item_reward[[email protected]]) + " at Zeny Roulette, get yours now!", 0; @level = 1; [email protected] = 1; break; } @level++; next; break; case 2: default: [email protected] = 1; break; } if ([email protected]) { [email protected] = 0; break; } } close2; cutin "", 255; end; function Roll { if (.zeny_required && .zeny_amt_need > Zeny) return "NZ"; Zeny -= .zeny_amt_need; [email protected] = getarg(0, 1); while(1) { [email protected] = 0; for ([email protected] = 1; [email protected] <= (10 - [email protected]); [email protected]++) { cutin [email protected] + "s_" + [email protected], 3; if (5 > rand(100)) { [email protected] = 1; [email protected]_cutin$ = [email protected] + "s_" + [email protected]; if ([email protected] == 1 || [email protected] == (10 - [email protected])) [email protected]_cutin$ = "NA"; break; } sleep2 100; } if ([email protected]) break; } return [email protected]_cutin$; } OnInit: .npc$ = "[^808080 " + strnpcinfo(1) + " ^000000]"; .zeny_required = 1; // 1 = yes / 0 = no .zeny_amt_need = 100000; // zeny amount needed setarray .item_cutin$[0], "1s_2", "1s_3", "1s_4", "1s_5", "1s_6", "1s_7", "1s_8", "2s_2", "2s_3", "2s_4", "2s_5", "2s_6", "2s_7", "3s_2", "3s_3", "3s_4", "3s_5", "3s_6", "4s_2", "4s_3", "4s_4", "4s_5", "5s_2", "5s_3", "5s_4", "6s_2", "6s_3", "7s_2"; setarray .item_reward[0], 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507; end; } You have to set the rewards properly
    setarray .item_cutin$[0], "1s_2", "1s_3", "1s_4", "1s_5", "1s_6", "1s_7", "1s_8", "2s_2", "2s_3", "2s_4", "2s_5", "2s_6", "2s_7", "3s_2", "3s_3", "3s_4", "3s_5", "3s_6", "4s_2", "4s_3", "4s_4", "4s_5", "5s_2", "5s_3", "5s_4", "6s_2", "6s_3", "7s_2"; setarray .item_reward[0], 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507;  
  21. Patskie's post in Abracadabra Skill Monster monster was marked as the answer   
    Comment this line and recompile your server
  22. Patskie's post in Hourly Reward mod was marked as the answer   
    Under OnInit label put below
    setarray .s_exclude_jobs[0], Job_Champion, Job_Professor, Job_Stalker; and then change below
    callsub Hourly_Rewads; to 
    if (inarray(.s_exclude_jobs, Class) == -1) callsub Hourly_Rewads;  
  23. Patskie's post in Annieruru bg_emp reward for loosing team request was marked as the answer   
    //===== 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 ( [email protected] = 5; [email protected] > 0; [email protected] ) { mapannounce "bat_a01", "["+ [email protected] +"]", 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 ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) getitem .rewarditem[0], .rewarditem[1], [email protected][[email protected]]; bg_get_data .loseside, 1; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) getitem 7829, 15, [email protected][[email protected]]; } 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  
  24. Patskie's post in R> Gold room when player die inside gold room 10% of gold loot will dropped was marked as the answer   
    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 [email protected]$, [email protected], [email protected]; [email protected] = countitem(.item) / 10; if ([email protected]) end; delitem .item, [email protected]; makeitem .item, [email protected], [email protected]$, [email protected], [email protected]; end; OnInit: .item = 969; // Gold end; } ordeal_3-1,0,0 monster Dokebi 1110,50,5000  
  25. Patskie's post in Smart Refine Announcement when exceed on safe limit was marked as the answer   
    Change 
    if (getequiprefinerycnt([email protected]) >= 7) announce "[Hollgrehenn]: "+strcharinfo(0)+" has successfully refined "+getequipname([email protected])+" to +"+getequiprefinerycnt([email protected])+"!",0; To
    switch (getiteminfo(getequipid([email protected]), 13)) { case 1: [email protected] = 9; break; case 2: [email protected] = 8; break; case 3: [email protected] = 6; break; case 4: [email protected] = 5; break; default: break; } if (getequiprefinerycnt([email protected]) >= [email protected]) announce "[Hollgrehenn]: "+strcharinfo(0)+" has successfully refined "+getequipname([email protected])+" to +"+getequiprefinerycnt([email protected])+"!",0;  
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.