Jump to content

peculiarro

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by peculiarro

  1. Yes, in random please. Like they will only get 1 of those Castle Drops.
  2. Hey, where will I put or what will I replace with OnMinute25 to have it automated?
  3. Wow thank you very much, here are the IDs 7088 7086 7075 7078 7083 7081 7090 7077 7079 7085 7089 7091 7074 7092 7082 7073 7076 7084 7080
  4. //===== rAthena Script ======================================= //= Euphy's WOE Controller //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.5 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= A controller for War of Emperium designed for //= simplicity and ease of use. //= Many concepts taken from ToastOfDoom's script, //= and "rewards" function originally by Goddameit. //===== Additional Comments: ================================= //= Be sure to disable the default agit controllers! //== npc\guild\agit_controller.txt //== npc\guild2\agit_start_se.txt //============================================================ // Information NPC //============================================================ prontera,154,196,4 script WOE Information 835,{ doevent "WOE_CONTROL::OnMenu"; end; OnAgitStart: while(agitcheck()) { specialeffect EF_BEGINSPELL6; sleep 425; } end; } // Script Core //============================================================ - script WOE_CONTROL -1,{ function Disp_Owner; function Add_Zero; OnInit: // ----------------------------------------------------------- // Configuration settings. // ----------------------------------------------------------- set .CastleWarp,0; // 1: Always enable all castle warps. | 0: Warp only to active castles. set .AutoKick,1; // Automatically kick players from inactive castles during WOE? (1:yes / 0:no) set .NoOwner,1; // Automatically kick players from unconquered castles outside of WOE? (1:yes / 0:no) set .ExitWarp,0; // Warp all players from castles when WOE ends? (1:yes / 0:no) set .GMAccess,99; // GM level required to access Session Manager. // ----------------------------------------------------------- // Reward options. // ----------------------------------------------------------- // [1] Enable rewards. // [2] Mail all rewards. // - If not set, players receive items in their inventory. // - Only ONE item can be sent via mail, plus Zeny. // - Note that offline players do NOT receive rewards. // [4] Only reward Guild Masters. // - If not set, all guild members are rewarded. // - If mailing is enabled (option 2), offline Guild Masters WILL receive rewards. // [8] Duplicate IP check. // - Members in a guild with the same IP address are not rewarded. // - If Guild Masters is enabled (option 4), this feature is not used. // ----------------------------------------------------------- // Combine values as needed (e.g. 1|8 = 1+8 = 9). set .Options, 1; // Rewards per castle. // -- when given directly: <itemID>,<amount>{,<itemID>,<amount>,...} // -- via mail (option 2): <itemID>,<amount>,<Zeny> setarray .Reward[0],29321,1; // ----------------------------------------------------------- // Constants (leave this section alone). // ----------------------------------------------------------- setarray .Castles$[0], "prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05", "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05", "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05", "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05", "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05", "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05"; setarray .EndLabel$[0],"ar01","ar02","ar03","ar04","ar05","sc01","sc02","sc03","sc04","sc05"; setarray .Days$[0],"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"; setarray .Regions$[0],"Prontera","Payon","Geffen","Aldebaran","Arunafeltz","Schwaltzvalt"; setarray .Map$[0],"prt_gld","pay_gld","gef_fild13","alde_gld","aru_gld","sch_gld"; setarray .MapX[0],134,240,153,111,208,121,295,317,140,204,214,308,143,193,305,48, 95,142,239,264,158,83, 68,299,292,293,288, 97,137, 71; setarray .MapY[0], 65,128,137,240,240,233,116,293,160,266, 75,240,240,278, 87,83,249, 85,242, 90,272,47,155,345,107,100,252,196, 90,315; // ----------------------------------------------------------- set .Size, getarraysize($WOE_CONTROL); if (.AutoKick || .NoOwner) for(set .@i,0; .@i<30; set .@i,.@i+1) { setmapflag .Castles$[.@i], mf_loadevent; setd "."+.Castles$[.@i], .@i; } if (!agitcheck() && !agitcheck2()) sleep 4000; set .Init,1; OnMinute00: freeloop(1); if (agitcheck() || agitcheck2()) { for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (gettime(4) == $WOE_CONTROL[.@i] && gettime(3) == $WOE_CONTROL[.@i+2]) { OnWOEEnd: announce "The War Of Emperium is over!",bc_all|bc_woe; AgitEnd; AgitEnd2; sleep 1000; for(set .@j,0; .@j<30; set .@j,.@j+1) { if (.Active[0]&(1<<.@j)) Disp_Owner(.Castles$[.@j],1); if (.ExitWarp) maprespawnguildid .Castles$[.@j],0,3; } if (.Options&1 && .Active[0] && .ForceEnd != 2) callsub OnReward, .Active[0]; deletearray .Active[0],2; if (.ForceEnd) { set .ForceEnd,0; end; } break; } } if ((!agitcheck() && !agitcheck2()) || .Init) { if (!agitcheck() && !agitcheck2()) set .Init,0; for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (gettime(4) == $WOE_CONTROL[.@i] && gettime(3) >= $WOE_CONTROL[.@i+1] && gettime(3) < $WOE_CONTROL[.@i+2]) { deletearray .Active[0],2; set .Active[0], $WOE_CONTROL[.@i+3]; if (.Init) { AgitEnd; AgitEnd2; } else announce "The War Of Emperium has begun!",bc_all|bc_woe; sleep 1000; AgitStart; AgitStart2; for(set .@j,0; .@j<30; set .@j,.@j+1) { if (.Active[0]&(1<<.@j)) { if (!.Init) Disp_Owner(.Castles$[.@j],0); set .Active[1], .Active[1] | (1<<((.@j/5)+1)); } else { if (.@j<20) { donpcevent "Agit#"+.Castles$[.@j]+"::OnAgitEnd"; killmonster .Castles$[.@j], "Agit#"+.Castles$[.@j]+"::OnAgitBreak"; } else { donpcevent "Manager#"+.Castles$[.@j]+"::OnAgitEnd2"; killmonster .Castles$[.@j], "Steward#"+.EndLabel$[.@j-20]+"::OnStartArena"; } } } break; } } set .Init,0; end; function Disp_Owner { set .@o, getcastledata(getarg(0),1); if (.@o) announce "The ["+getcastlename(getarg(0))+"] castle "+((getarg(1))?"has been conquered":"is currently held")+" by the ["+getguildname(.@o)+"] guild.",bc_all|bc_woe; else announce "The ["+getcastlename(getarg(0))+"] castle is currently unoccupied.",bc_all|bc_woe; return; } function Add_Zero { return ((getarg(0)<10)?"0":"")+getarg(0)+(getarg(1,0)?".":":")+"00"; } OnReward: set .@sql$, ((.Options&4)?"position = 0":"online = 1"); if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21); freeloop(1); for(set .@i,0; .@i<30; set .@i,.@i+1) if (getarg(0)&(1<<.@i)) { set .@gid, getcastledata(.Castles$[.@i],1); if (!.@gid) continue; set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid); for(set .@j,0; .@j<.@size; set .@j,.@j+1) { if (.Options&8 && !(.Options&4)) { set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a"); if (getd(".@ip_"+.@i+"_"+.@ip$)) continue; setd ".@ip_"+.@i+"_"+.@ip$,1; } if (.Options&2) { query_sql("INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) VALUES ("+ "'no-reply',"+.@cid[.@j]+",'** Siege Reward: "+getcastlename(.Castles$[.@i])+" **',"+ "'Brave one,% % Congratulations!% Your guild has successfully occupied% territory in the War of Emperium on% "+.@str$+".% % % % % [ Your reward is attached. ]',"+ .Reward[0]+","+.Reward[1]+",0,"+.Reward[2]+",UNIX_TIMESTAMP(NOW()))"); if (!getd(".@str_"+.@cid[.@j]) && isloggedin(.@aid[.@j],.@cid[.@j])) { setd ".@str_"+.@cid[.@j],1; message rid2name(.@aid[.@j]),"You've got mail! Please re-login to update your mailing list."; } } else if (isloggedin(.@aid[.@j])) { for(set .@k,0; .@k<getarraysize(.Reward); set .@k,.@k+2) getitem .Reward[.@k], .Reward[.@k+1], .@aid[.@j]; message rid2name(.@aid[.@j]),"You have been rewarded for conquering "+getcastlename(.Castles$[.@i])+"."; } } } if (.Options&2) query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'"); return; OnPCLoadMapEvent: if (!compare(strcharinfo(3),"g_cas")) end; if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(3),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(3))))) { if (getcharid(2) && getcastledata(strcharinfo(3),1) == getcharid(2)) end; sleep2 1000; message strcharinfo(0), getcastlename(strcharinfo(3))+" is currently inactive."; sleep2 5000; if (compare(strcharinfo(3),"g_cas")) warp "SavePoint",0,0; } end; OnMenu: while(1) { mes "[WOE Information]"; if (agitcheck() || agitcheck2()) { if (.Active[0]) { for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (gettime(4) == $WOE_CONTROL[.@i] && gettime(3) >= $WOE_CONTROL[.@i+1] && gettime(3) < $WOE_CONTROL[.@i+2]) { set .@i, $WOE_CONTROL[.@i+2]; break; } mes "The War of Emperium is ^0055FFactive^000000 until ^FF0000"+Add_Zero(.@i)+"^000000 in the following regions:"; mes " "; for(set .@i,0; .@i<6; set .@i,.@i+1) if (.Active[1]&(1<<(.@i+1))) mes " > ^777777"+.Regions$[.@i]+"^000000"; } else mes "The War of Emperium is ^0055FFactive^000000."; } else { for(set .@i,0; .@i<.Size; set .@i,.@i+4) if ((gettime(4) == $WOE_CONTROL[.@i] && gettime(3) <= $WOE_CONTROL[.@i+1]) || gettime(4) < $WOE_CONTROL[.@i]) { setarray .@time[0],$WOE_CONTROL[.@i],$WOE_CONTROL[.@i+1]; break; } if (!getarraysize(.@time)) setarray .@time[0],$WOE_CONTROL[0],$WOE_CONTROL[1]; mes "The War of Emperium is ^777777inactive^000000."; if (.Size) { mes " "; mes "The next session will begin"; mes "on ^0055FF"+.Days$[.@time[0]]+"^000000 at "+Add_Zero(.@time[1])+"^000000."; } } next; switch(select(""+((.CastleWarp || .Active[1])?" ~ Warp to castles...":"")+": ~ Check schedule...: ~ View castle owners...:"+((getgmlevel()<.GMAccess || !getgmlevel())?"":" ~ Manage sessions...")+": ~ ^777777Cancel^000000")) { case 1: if (.CastleWarp) set .@clr$,"^0055FF"; set .@menu$,""; for(set .@i,0; .@i<6; set .@i,.@i+1) { if (.CastleWarp || .Active[1]&(1<<(.@i+1))) set .@menu$, .@menu$+" ~ "+((.Active[1]&(1<<(.@i+1)))?.@clr$:"^777777")+.Regions$[.@i]+" Castles^000000"; set .@menu$, .@menu$+":"; } set .@i, select(.@menu$)-1; set .@menu$,""; for(set .@j,.@i*5; .@j<(.@i*5)+5; set .@j,.@j+1) { if (.CastleWarp || .Active[0]&(1<<.@j)) set .@menu$, .@menu$+" ~ "+((.Active[0]&(1<<.@j))?.@clr$:"^777777")+getcastlename(.Castles$[.@j])+"^000000"; set .@menu$, .@menu$+":"; } set .@j, select(.@menu$)-1; warp .Map$[.@i],.MapX[(.@i*5)+.@j],.MapY[(.@i*5)+.@j]; close; case 2: mes "[Schedule]"; if (.Size) { freeloop(1); for(set .@i,0; .@i<.Size; set .@i,.@i+4) { mes "> ^FF0000"+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1])+"-"+Add_Zero($WOE_CONTROL[.@i+2])+")^000000"; for(set .@j,0; .@j<30; set .@j,.@j+1) if ($WOE_CONTROL[.@i+3]&(1<<.@j)) mes " ~ "+getcastlename(.Castles$[.@j])+" ^777777("+.Castles$[.@j]+")^000000"; if (.@i+4 < .Size) mes " "; } freeloop(0); } else mes "No times are configured."; next; break; case 3: mes "[Castle Ownership]"; for(set .@i,0; .@i<6; set .@i,.@i+1) { set .@k, .@i*5; mes "> ^FF0000"+.Regions$[.@i]+"^000000"; for(set .@j,.@k; .@j<(.@k+5); set .@j,.@j+1) { set .@t, getcastledata(.Castles$[.@j],1); mes " ~ "+getcastlename(.Castles$[.@j])+": "+((.@t)?"^0055FF"+getguildname(.@t):"^777777unoccupied")+"^000000"; } if (.@i < 5) mes " "; } next; break; case 4: while(1) { mes "[Session Manager]"; mes "There are ^0055FF"+(.Size/4)+" session(s)^000000 configured."; mes "What would you like to do?"; next; switch(select(" ~ Add a session...: ~ Delete a session...: ~ Reload settings...:"+((agitcheck() || agitcheck2())?" ~ End WOE session...":"")+": ~ ^777777Go back^000000")) { case 1: mes "[New Session]"; if (.Size > 127) { mes "You have already reached the maximum of 32 sessions."; next; break; } mes "Select a day."; next; set .@Day, select(" ~ "+implode(.Days$,": ~ "))-1; mes "[New Session]"; mes "Select a start time for ^0055FF"+.Days$[.@Day]+"^000000."; next; set .@menu$,""; for(set .@i,0; .@i<23; set .@i,.@i+1) set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":"; set .@Start, select(.@menu$)-1; mes "[New Session]"; mes "Select an end time for ^0055FF"+.Days$[.@Day]+"^000000."; next; set .@menu$,""; for(set .@i,.@Start+1; .@i<24; set.@i,.@i+1) set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":"; set .@End, select(.@menu$)+.@Start; for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (.@Day == $WOE_CONTROL[.@i] && ((.@Start >= $WOE_CONTROL[.@i+1] && .@Start < $WOE_CONTROL[.@i+2]) || (.@End > $WOE_CONTROL[.@i+1] && .@End <= $WOE_CONTROL[.@i+2]) || (.@Start <= $WOE_CONTROL[.@i+1] && .@End >= $WOE_CONTROL[.@i+2]))) { mes "[New Session]"; mes "The chosen times overlap with an existing session."; next; set .@d,1; break; } if (.@d) { set .@d,0; break; } set .@Castle,0; while(1) { mes "[New Session]"; mes "^0055FF"+.Days$[.@Day]+" ("+Add_Zero(.@Start)+"-"+Add_Zero(.@End)+")^000000"; mes " > Castles:"; if (!.@Castle) mes " ~ ^777777(none selected)^000000"; else for(set .@i,0; .@i<30; set .@i,.@i+1) if (.@Castle&(1<<.@i)) mes " ~ "+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")"; next; set .@menu$,((.@Castle)?" ~ ^FF0000Finished...^000000":"")+":"; for(set .@i,0; .@i<30; set .@i,.@i+1) set .@menu$, .@menu$+" ~ "+((.@Castle&(1<<.@i))?"^0055FF":"")+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")^000000:"; set .@i, select(.@menu$)-1; if (.@i) set .@Castle, .@Castle^(1<<(.@i-1)); else { mes "[New Session]"; mes "Are you sure?"; next; switch(select(" ~ ^0055FFAdd session...^000000: ~ Continue selecting castles...: ~ ^777777Cancel^000000")) { case 1: for(set .@i,0; .@i<.Size; set .@i,.@i+4) if ((.@Day == $WOE_CONTROL[.@i] && .@End <= $WOE_CONTROL[.@i+1]) || .@Day < $WOE_CONTROL[.@i]) { set .@d,1; break; } if (!.@d) { set .@d,1; set .@i,.Size; } copyarray $WOE_CONTROL[.@i+4], $WOE_CONTROL[.@i], .Size-.@i; setarray $WOE_CONTROL[.@i], .@Day, .@Start, .@End, .@Castle; set .Size, getarraysize($WOE_CONTROL); case 3: mes "[New Session]"; mes ((.@d)?"Session added.":"Cancelled."); next; set .@d,1; case 2: break; } if (.@d) { set .@d,0; break; } } } break; case 2: mes "[Remove Session]"; if (!.Size) { mes "There are no sessions configured."; next; break; } mes "Select a session to remove."; next; set .@menu$,""; for(set .@i,0; .@i<.Size; set .@i,.@i+4) set .@menu$, .@menu$+" ~ "+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1],1)+"-"+Add_Zero($WOE_CONTROL[.@i+2],1)+"):"; set .@menu$, .@menu$+" ~ ^777777Cancel^000000"; set .@i, select(.@menu$)-1; if (.@i == (.Size/4)) break; mes "[Remove Session]"; mes "Delete ^0055FF"+.Days$[$WOE_CONTROL[.@i*4]]+"'s^000000 session?"; mes "This action cannot be undone."; next; set .@j, select(" ~ ^FF0000Delete session...^000000: ~ ^777777Cancel^000000"); mes "[Remove Session]"; if (.@j == 2) mes "Cancelled."; else { deletearray $WOE_CONTROL[.@i*4],4; set .Size, getarraysize($WOE_CONTROL); mes "Session deleted."; } next; break; case 3: mes "[Reload Settings]"; mes "This will trigger all events related to new session configurations, if any."; if (agitcheck() || agitcheck2()) { mes " "; mes "Be aware that this will disrupt the current WOE session."; } next; set .@i, select(" ~ ^0055FFReload settings...^000000: ~ ^777777Cancel^000000"); mes "[Reload Settings]"; if (.@i == 2) mes "Cancelled."; else { set .Init,1; donpcevent "WOE_CONTROL::OnMinute00"; mes "Variables have been re-initialized."; } next; break; case 4: mes "[Force Agit End]"; if (!agitcheck() && !agitcheck2()) { mes "WOE has already ended."; next; break; } mes "This command will safely execute all AgitEnd events."; mes " "; mes "Kill the current WOE session?"; next; set .@i, select(" ~ ^FF0000End session...^000000:"+((.Options&1)?" ~ ^FF0000End session without rewards...^000000":"")+": ~ ^777777Cancel^000000"); mes "[Force Agit End]"; if (.@i == 3) mes "Cancelled."; else { set .ForceEnd, .@i; donpcevent "WOE_CONTROL::OnWOEEnd"; mes "WOE session terminated."; } next; break; case 5: set .@d,1; break; } if (.@d) { set .@d,0; break; } } break; case 5: close; } } } Can someone help me add a random castle drop at rewards
  5. Hi, may I request an NPC that will have a menu of warping to a private dead branch room, and another for "Shop", which the player buys Dead Branch?
  6. Hi sir, may I request multi mixtures as well?
  7. //===== eAthena Script ======================================= //= Guarantee Refine Ticket //===== By: ================================================== //= Euphy / GM Takumirai //===== Current Version: ===================================== //= 1.1a //===== Description: ========================================= //= Uses [Guarantee Refine Ticket] to refine weapons/armor. //============================================================ function script GuaranteeRefine { set .@CleanEquip,1; // Only refine +0 equipment? (1:yes / 0:no) if (!getarg(1)) { message strcharinfo(0)," ~~ Guarantee Refine Ticket +"+getarg(0)+" ~~ "; for(set .@i,1; .@i<=10; set .@i,.@i+1) { if (getequipisequiped(.@i) && !getiteminfo(getequipid(.@i),13)) set .@menu$, .@menu$+getequipname(.@i); set .@menu$, .@menu$+":"; } set .@s, select(.@menu$); } else set .@s, getarg(1); if (!getequipisequiped(.@s)) { dispbottom "Nothing is equipped!"; close; } if (!getequipisenableref(.@s)) { dispbottom getequipname(.@s)+" cannot be refined."; close; } if (getequiprefinerycnt(.@s) >= 20 || (.@CleanEquip && getequiprefinerycnt(.@s))) { dispbottom "+"+getequiprefinerycnt(.@s)+" "+getequipname(.@s)+" cannot be refined any further."; close; } if (getarg(1)) message strcharinfo(0)," ~~ Guarantee Refine Ticket +"+getarg(0)+" ~~ "; if(select("^0055FFRefine +"+getequiprefinerycnt(.@s)+" "+getequipname(.@s)+":^777777Cancel^000000")==2) close; pcblockmove getcharid(3),1; specialeffect2 348; progressbar "",2; if (!countitem(getarg(2))) { dispbottom "Refine failed. Ticket not found."; close; } for(set .@i,0; .@i<getarg(0); set .@i,.@i+1) { if (getequiprefinerycnt(.@s) >= 20) break; successrefitem .@s; } delitem getarg(2),1; pcblockmove getcharid(3),0; close; } /* Copy the following into db\item_db2.txt: 6228,Guarantee_Weapon_9Up,Guarantee Weapon 9Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",9,4,6228; },{},{} 6229,Guarantee_Weapon_8Up,Guarantee Weapon 8Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",8,4,6229; },{},{} 6230,Guarantee_Weapon_7Up,Guarantee Weapon 7Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",7,4,6230; },{},{} 6231,Guarantee_Weapon_6Up,Guarantee Weapon 6Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",6,4,6231; },{},{} 6232,Guarantee_Armor_9Up,Guarantee Armor 9Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",9,0,6232; },{},{} 6233,Guarantee_Armor_8Up,Guarantee Armor 8Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",8,0,6233; },{},{} 6234,Guarantee_Armor_7Up,Guarantee Armor 7Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",7,0,6234; },{},{} 6235,Guarantee_Armor_6Up,Guarantee Armor 6Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",6,0,6235; },{},{} 6238,Guarantee_Weapon_11Up,Guarantee Weapon 11Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",11,4,6238; },{},{} 6239,Guarantee_Armor_11Up,Guarantee Armor 11Up,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "GuaranteeRefine",11,0,6239; },{},{} */ Whenever I click the item, it keeps saying nothing is equipped. Help! Help!
  8. Hi, when I use magic rod. It does not activate. But when I bolt other players, they can get it to work. Is this a bug?
  9. //===== rAthena Script ======================================= //= Disguise Event //===== By: ================================================== //= GmOcean //===== Current Version: ===================================== //= 5.1 //===== Compatible With: ===================================== //= rAthena SVN //===== Additional Comments: ================================= //= Note: This script requires PCRE to run properly. //= 5.0 Last update by GmOcean. //= 5.1 Cleaned and standardized, mostly. [Euphy] //============================================================ prontera,155,156,3 script Disguise Event 795,{ // Currently set to run every two hours. // To change times, edit the OnClock labels below. set .@GMLevel,99; // GM level required to access NPC. set .@n$,"[^0000FFDisguise NPC^000000]"; if (getgmlevel()>=.@GMLevel) { mes .@n$; mes "Select an option."; next; switch(select("Turn ON/OFF Event:Event Settings")) { case 1: mes .@n$; if (.EventON) { mes "The Event is currently: [^0000FFON^000000]"; mes "Would you like to turn it OFF?"; } else { mes "The Event is currently: [^FF0000OFF^000000]"; mes "Would you like to turn it ON?"; } if(select("Yes:No")==2) close; if (.EventON) { set .EventON,0; set .Timer,0; setnpctimer 0; stopnpctimer; announce "A GM has decided to turn the Disguise Event off. As a result no further prizes will be given.",0,0x00CCFF; deletepset 1; setnpcdisplay "Disguise Event",795; close; } set .EventON,1; set .Timer,1; setnpctimer 0; initnpctimer; set .ResetCounter,.ResetCounter+1; announce "The Disguise Event will begin in 3 minutes.",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; close; case 2: mes .@n$; mes "Pick a setting to modify."; next; switch(select("Monster Display:Number of Rounds:Prize Settings")) { case 1: setarray .@r$[0],"Disguise as all monsters.","Disguise as MVPs only."; mes .@n$; mes "Choose a disguise rule."; next; set .Rule, select(implode(.@r$,":")); mes .@n$; mes "The Disguise Rule has been set:"; mes " > ^0055FF"+.@r$[.Rule-1]+"^000000"; close; case 2: mes .@n$; mes "Input the number of rounds you want the event to last."; mes "Current number: [^0000FF"+.Rounds+"^000000]"; next; input .@Rounds; set .Rounds,.@Rounds; mes .@n$; mes "The number of rounds has been changed to "+.Rounds+"."; close; case 3: mes .@n$; mes "Input the Item ID of the prize given each round."; mes "Current item: [^0000FF"+getitemname(.Prize)+"^000000] (ID #"+.Prize+")"; next; input .@Prize; mes .@n$; if (getitemname(.@Prize)=="" || getitemname(.@Prize)=="null") { mes "That item does not exist. Please try again."; close; } set .Prize,.@Prize; mes "Input the amount to be given."; next; input .@amount; mes .@n$; if (.@amount<=0 || .@amount>=10000) { mes "That amount is invalid. Using default ammount of 1."; set .@amount,1; next; mes .@n$; } set .PrizeAmt,.@amount; mes "The Prize has been changed successfully."; mes "Prize: "+.PrizeAmt+"x [^0000FF"+getitemname(.Prize)+"^000000]"; close; } } } if (.EventON) end; mes .@n$; mes "Welcome."; mes "How may I be of assistance?"; if(select("Information:Nothing, just passing through.")==2) close; next; mes .@n$; mes "This event is quite simple."; mes "At the start of the event, I will"; mes "disguise myself as a random"; mes "monster. You have to shout"; mes "that monter's name out loud."; next; mes "If you are correct, you will receive"; mes "a prize. If not, keep trying!"; mes "That's all that there is to this event."; close; OnInit: set .EventON,0; set .Wait,0; set .Winner,0; set .ResetCounter,0; set .Rounds,10; set .Prize,7227; set .PrizeAmt,1; set .Rule,1; setarray .MVP[0],1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373, 1389,1399,1418,1492,1502,1511,1583,1623,1630,1646,1647,1648,1649,1650,1651,1658,1685,1688, 1708,1719,1734,1751,1768,1779,1785,1802,1832,1871,1874,1885,1917,1980,2022,2068,2087,2131, 2156,2165; set .BlackList$, "1003,1006,1017,1021,1022,1027,1043,1075,1136,1137,1168," + "1171,1172,1173,1181,1187,1210,1217,1218,1222,1223,1224,1225,1226,1227,1228," + "1233,1284,1407,1411,1414,1495,1501,1900,1996,2000,2001,2002,2003,2004," + "2005,2006,2007,2011,2012,2025,2028,2029,2030,2031,2032,2033,2034,2035," + "2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049," + "2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063," + "2064,2065,2066,2067,2075,2076,2077,2078,2079,2080,2081,2083,2084,2085," + "2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099," + "2100,2101,2012,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113," + "2114,2115,2116,2117,2118,2119,2120,2121,2123,2124,2125,1496,"; end; OnMinute59: set .ResetCounter,.ResetCounter+1; set .EventON,1; set .Timer,1; set .Wait,1; announce "The Disguise Event will begin in 3 minutes.",0,0x00CCFF; announce "The Event is being held in Main Town near at the Market.",0,0x00CCFF; setnpctimer 0; initnpctimer; end; OnTimer10000: if (.Timer || .Change) end; set .Wait,0; goto iDisguise; end; OnTimer30000: if (.Timer) end; set .Change,0; setnpcdisplay "Disguise Event",795; npctalk "You took too long to guess what I was. Please wait 10 seconds while I disguise again."; specialeffect 725; set $MonsterName$,""; deletepset 1; stopnpctimer; setnpctimer 0; initnpctimer; end; OnTimer60000: if (.Timer!=1) end; announce "The Disguise Event will begin in 2 minutes.",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; end; OnTimer120000: if (.Timer!=1) end; announce "The Disguise Event will begin 1 minute.",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; end; OnTimer180000: if (.Timer!=1) end; announce "The Disguise Event has begun!",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; set .Timer,0; stopnpctimer; setnpctimer 0; initnpctimer; iDisguise: if (.Rule==1) { set .Winner,0; set .Monster,1000+rand(1,995); if (compare(","+.BlackList$+"," , ","+.Monster+",")) goto iDisguise; if (.Monster==.LastMonster) goto iDisguise; set .LastMonster,.Monster; set $MonsterName$,getmonsterinfo(.Monster,0); } if (.Rule==2) { set .Winner,0; set .Monster,rand(49); set $MonsterName$,getmonsterinfo(.MVP[.Monster],0); } deletepset 1; defpattern 1,"([^:]+):.\\s*"+$MonsterName$+".*", "iCorrect"; activatepset 1; if (.Rule==1) setnpcdisplay "Disguise Event",.Monster; if (.Rule==2) setnpcdisplay "Disguise Event",.MVP[.Monster]; set .Change,1; setnpctimer 0; end; iCorrect: if (.Winner) { dispbottom "Someone has already won this round."; end; } set .Winner,1; set .RoundCount,.RoundCount+1; deletepset 1; activatepset 1; getitem .Prize,.PrizeAmt; announce strcharinfo(0)+" is correct! I was disguised as: "+$MonsterName$+"",0,0x00CCFF; if (.RoundCount>=.Rounds) { setnpcdisplay "Disguise Event",795; set .RoundCount,0; set .Change,0; set .EventON,0; setnpctimer 0; stopnpctimer; npctalk "Thank you all for playing. That was the last round of the Disguise Event. Come play again later."; end; } setnpcdisplay "Disguise Event",795; set .Change,0; setnpctimer 0; end; } Changed it to this, hope it works
  10. //===== rAthena Script ======================================= //= Disguise Event //===== By: ================================================== //= GmOcean //===== Current Version: ===================================== //= 5.1 //===== Compatible With: ===================================== //= rAthena SVN //===== Additional Comments: ================================= //= Note: This script requires PCRE to run properly. //= 5.0 Last update by GmOcean. //= 5.1 Cleaned and standardized, mostly. [Euphy] //============================================================ prontera,155,156,3 script Disguise Event 795,{ // Currently set to run every two hours. // To change times, edit the OnClock labels below. set .@GMLevel,99; // GM level required to access NPC. set .@n$,"[^0000FFDisguise NPC^000000]"; if (getgmlevel()>=.@GMLevel) { mes .@n$; mes "Select an option."; next; switch(select("Turn ON/OFF Event:Event Settings")) { case 1: mes .@n$; if (.EventON) { mes "The Event is currently: [^0000FFON^000000]"; mes "Would you like to turn it OFF?"; } else { mes "The Event is currently: [^FF0000OFF^000000]"; mes "Would you like to turn it ON?"; } if(select("Yes:No")==2) close; if (.EventON) { set .EventON,0; set .Timer,0; setnpctimer 0; stopnpctimer; announce "A GM has decided to turn the Disguise Event off. As a result no further prizes will be given.",0,0x00CCFF; deletepset 1; setnpcdisplay "Disguise Event",795; close; } set .EventON,1; set .Timer,1; setnpctimer 0; initnpctimer; set .ResetCounter,.ResetCounter+1; announce "The Disguise Event will begin in 3 minutes.",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; close; case 2: mes .@n$; mes "Pick a setting to modify."; next; switch(select("Monster Display:Number of Rounds:Prize Settings")) { case 1: setarray .@r$[0],"Disguise as all monsters.","Disguise as MVPs only."; mes .@n$; mes "Choose a disguise rule."; next; set .Rule, select(implode(.@r$,":")); mes .@n$; mes "The Disguise Rule has been set:"; mes " > ^0055FF"+.@r$[.Rule-1]+"^000000"; close; case 2: mes .@n$; mes "Input the number of rounds you want the event to last."; mes "Current number: [^0000FF"+.Rounds+"^000000]"; next; input .@Rounds; set .Rounds,.@Rounds; mes .@n$; mes "The number of rounds has been changed to "+.Rounds+"."; close; case 3: mes .@n$; mes "Input the Item ID of the prize given each round."; mes "Current item: [^0000FF"+getitemname(.Prize)+"^000000] (ID #"+.Prize+")"; next; input .@Prize; mes .@n$; if (getitemname(.@Prize)=="" || getitemname(.@Prize)=="null") { mes "That item does not exist. Please try again."; close; } set .Prize,.@Prize; mes "Input the amount to be given."; next; input .@amount; mes .@n$; if (.@amount<=0 || .@amount>=10000) { mes "That amount is invalid. Using default ammount of 1."; set .@amount,1; next; mes .@n$; } set .PrizeAmt,.@amount; mes "The Prize has been changed successfully."; mes "Prize: "+.PrizeAmt+"x [^0000FF"+getitemname(.Prize)+"^000000]"; close; } } } if (.EventON) end; mes .@n$; mes "Welcome."; mes "How may I be of assistance?"; if(select("Information:Nothing, just passing through.")==2) close; next; mes .@n$; mes "This event is quite simple."; mes "At the start of the event, I will"; mes "disguise myself as a random"; mes "monster. You have to shout"; mes "that monter's name out loud."; next; mes "If you are correct, you will receive"; mes "a prize. If not, keep trying!"; mes "That's all that there is to this event."; close; OnInit: set .EventON,0; set .Wait,0; set .Winner,0; set .ResetCounter,0; set .Rounds,10; set .Prize,7227; set .PrizeAmt,1; set .Rule,1; setarray .MVP[0],1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373, 1389,1399,1418,1492,1502,1511,1583,1623,1630,1646,1647,1648,1649,1650,1651,1658,1685,1688, 1708,1719,1734,1751,1768,1779,1785,1802,1832,1871,1874,1885,1917,1980,2022,2068,2087,2131, 2156,2165; set .BlackList$, "1003,1006,1017,1021,1022,1027,1043,1075,1136,1137,1168," + "1171,1172,1173,1181,1187,1210,1217,1218,1222,1223,1224,1225,1226,1227,1228," + "1233,1284,1407,1411,1414,1495,1501,1900,1996,2000,2001,2002,2003,2004," + "2005,2006,2007,2011,2012,2025,2028,2029,2030,2031,2032,2033,2034,2035," + "2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049," + "2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063," + "2064,2065,2066,2067,2075,2076,2077,2078,2079,2080,2081,2083,2084,2085," + "2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099," + "2100,2101,2012,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113," + "2114,2115,2116,2117,2118,2119,2120,2121,2123,2124,2125,1496,"; end; OnClock0100: OnClock0200: OnClock0300: OnClock0400: OnClock0500: OnClock0600: OnClock0700: OnClock0800: OnClock0900: OnClock1000: OnClock1100: OnClock1200: OnClock2000: set .ResetCounter,.ResetCounter+1; set .EventON,1; set .Timer,1; set .Wait,1; announce "The Disguise Event will begin in 3 minutes.",0,0x00CCFF; announce "The Event is being held in Main Town near at the Market.",0,0x00CCFF; setnpctimer 0; initnpctimer; end; OnTimer10000: if (.Timer || .Change) end; set .Wait,0; goto iDisguise; end; OnTimer30000: if (.Timer) end; set .Change,0; setnpcdisplay "Disguise Event",795; npctalk "You took too long to guess what I was. Please wait 10 seconds while I disguise again."; specialeffect 725; set $MonsterName$,""; deletepset 1; stopnpctimer; setnpctimer 0; initnpctimer; end; OnTimer60000: if (.Timer!=1) end; announce "The Disguise Event will begin in 2 minutes.",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; end; OnTimer120000: if (.Timer!=1) end; announce "The Disguise Event will begin 1 minute.",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; end; OnTimer180000: if (.Timer!=1) end; announce "The Disguise Event has begun!",0,0x00CCFF; announce "The Event is being held in Prontera.",0,0x00CCFF; announce "Just type '@go 0' to join.",0,0x00CCFF; set .Timer,0; stopnpctimer; setnpctimer 0; initnpctimer; iDisguise: if (.Rule==1) { set .Winner,0; set .Monster,1000+rand(1,995); if (compare(","+.BlackList$+"," , ","+.Monster+",")) goto iDisguise; if (.Monster==.LastMonster) goto iDisguise; set .LastMonster,.Monster; set $MonsterName$,getmonsterinfo(.Monster,0); } if (.Rule==2) { set .Winner,0; set .Monster,rand(49); set $MonsterName$,getmonsterinfo(.MVP[.Monster],0); } deletepset 1; defpattern 1,"([^:]+):.\\s*"+$MonsterName$+".*", "iCorrect"; activatepset 1; if (.Rule==1) setnpcdisplay "Disguise Event",.Monster; if (.Rule==2) setnpcdisplay "Disguise Event",.MVP[.Monster]; set .Change,1; setnpctimer 0; end; iCorrect: if (.Winner) { dispbottom "Someone has already won this round."; end; } set .Winner,1; set .RoundCount,.RoundCount+1; deletepset 1; activatepset 1; getitem .Prize,.PrizeAmt; announce strcharinfo(0)+" is correct! I was disguised as: "+$MonsterName$+"",0,0x00CCFF; if (.RoundCount>=.Rounds) { setnpcdisplay "Disguise Event",795; set .RoundCount,0; set .Change,0; set .EventON,0; setnpctimer 0; stopnpctimer; npctalk "Thank you all for playing. That was the last round of the Disguise Event. Come play again later."; end; } setnpcdisplay "Disguise Event",795; set .Change,0; setnpctimer 0; end; } How to make it hourly =((
  11. Any free game guard you would recommend? Need it for my server.
  12. I applied this diff, then got this error. Here is my diff file. Needs fixing asap =( diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf index 593d4e9..30251a4 100644 --- conf/battle/battle.conf +++ conf/battle/battle.conf @@ -158,3 +158,9 @@ warg_can_falcon: no // Should the target be able of dodging damage by snapping away to the edge of the screen? // Official behavior is "no" snap_dodge: no + +// **************************************** +// Reserved Costume ID's +// **************************************** +// Reserved Char ID for costume converted items. +reserved_costume_id: 999998 \ No newline at end of file diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a4d6500..99ba739 100644 --- doc/script_commands.txt +++ doc/script_commands.txt @@ -9332,6 +9332,25 @@ solution rather than sending the map and the monster_id. --------------------------------------- +*costume <equipment position>; + +Converts equipment in <equipment position> to costume version that has no stats. + +Applicable positions are: + EQI_HEAD_TOP - Top Headgear + EQI_HEAD_MID - Middle Headgear + EQI_HEAD_LOW - Lower Headgear + EQI_GARMENT - Garment + +--------------------------------------- + +*getcostumeitem <item id>; +*getcostumeitem <"item name">; + +Spawn a costume version of an <item id> or <"item name"> in attached player's inventory. + +--------------------------------------- + *hateffect(<Hat Effect ID>,<State>); This will set a Hat Effect onto the player. The state field allows you to diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 7190474..39fad9b 100644 --- src/map/atcommand.c +++ src/map/atcommand.c @@ -1204,7 +1204,7 @@ ACMD_FUNC(heal) ACMD_FUNC(item) { char item_name[100]; - int number = 0, bound = BOUND_NONE; + int number = 0, bound = BOUND_NONE, costume = 0; char flag = 0; struct item item_tmp; struct item_data *item_data[10]; @@ -1253,6 +1253,27 @@ ACMD_FUNC(item) for(j--; j>=0; j--){ //produce items in list unsigned short item_id = item_data[j]->nameid; + if (!strcmpi(command + 1, "costumeitem")) + { + if (!battle_config.reserved_costume_id) + { + clif_displaymessage(fd, "Costume convertion is disable. Set a value for reserved_cosutme_id on your battle.conf file."); + return -1; + } + if (!(item_data[j]->equip&EQP_HEAD_LOW) && + !(item_data[j]->equip&EQP_HEAD_MID) && + !(item_data[j]->equip&EQP_HEAD_TOP) && + !(item_data[j]->equip&EQP_COSTUME_HEAD_LOW) && + !(item_data[j]->equip&EQP_COSTUME_HEAD_MID) && + !(item_data[j]->equip&EQP_COSTUME_HEAD_TOP) && + !(item_data[j]->equip&EQP_GARMENT) && + !(item_data[j]->equip&EQP_COSTUME_GARMENT)) + { + clif_displaymessage(fd, "You cannot costume this item. Costume only work for headgears."); + return -1; + } + costume = 1; + } //Check if it's stackable. if (!itemdb_isstackable2(item_data[j])) get_count = 1; @@ -1263,6 +1284,11 @@ ACMD_FUNC(item) memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; + if (costume == 1) { // Costume item + item_tmp.card[0] = CARD0_CREATE; + item_tmp.card[2] = GetWord(battle_config.reserved_costume_id, 0); + item_tmp.card[3] = GetWord(battle_config.reserved_costume_id, 1); + } item_tmp.bound = bound; if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); @@ -10171,6 +10197,7 @@ void atcommand_basecommands(void) { ACMD_DEF(clonestat), ACMD_DEF(bodystyle), ACMD_DEF(adopt), + ACMD_DEF2("costumeitem", item), ACMD_DEF(agitstart3), ACMD_DEF(agitend3), }; diff --git a/src/map/battle.c b/src/map/battle.c index 966af8e..4c8b1e6 100644 --- src/map/battle.c +++ src/map/battle.c @@ -8379,6 +8379,7 @@ static const struct _battle_data { { "exp_cost_inspiration", &battle_config.exp_cost_inspiration, 1, 0, 100, }, { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, }, { "can_damage_skill", &battle_config.can_damage_skill, 1, 0, BL_ALL, }, + { "reserved_costume_id", &battle_config.reserved_costume_id, 999998, 0, INT_MAX, }, { "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, }, { "block_account_in_same_party", &battle_config.block_account_in_same_party, 1, 0, 1, }, { "tarotcard_equal_chance", &battle_config.tarotcard_equal_chance, 0, 0, 1, }, diff --git a/src/map/battle.h b/src/map/battle.h index e4c08a3..50daa5e 100644 --- src/map/battle.h +++ src/map/battle.h @@ -610,6 +610,7 @@ extern struct Battle_Config int exp_cost_inspiration; int mvp_exp_reward_message; int can_damage_skill; //Which BL types can damage traps + int reserved_costume_id; int atcommand_levelup_events; int block_account_in_same_party; int tarotcard_equal_chance; //Official or equal chance for each card diff --git a/src/map/map.c b/src/map/map.c index 524dcec..92f4e0f 100644 --- src/map/map.c +++ src/map/map.c @@ -1879,6 +1879,12 @@ void map_reqnickdb(struct map_session_data * sd, int charid) nullpo_retv(sd); + if (battle_config.reserved_costume_id && battle_config.reserved_costume_id == charid) + { + clif_solved_charname(sd->fd, charid, "Costume"); + return; + } + tsd = map_charid2sd(charid); if( tsd ) { diff --git a/src/map/pc.c b/src/map/pc.c index 7c939f0..005d857 100755 --- src/map/pc.c +++ src/map/pc.c @@ -683,6 +683,15 @@ int pc_equippoint(struct map_session_data *sd,int n){ (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech] return EQP_ARMS; } + if (battle_config.reserved_costume_id && + sd->inventory.u.items_inventory[n].card[0] == CARD0_CREATE && + MakeDWord(sd->inventory.u.items_inventory[n].card[2], sd->inventory.u.items_inventory[n].card[3]) == battle_config.reserved_costume_id) + { // Costume Item - Converted + if (ep&EQP_HEAD_TOP) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; } + if (ep&EQP_HEAD_LOW) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; } + if (ep&EQP_HEAD_MID) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; } + if (ep&EQP_GARMENT) { ep &= ~EQP_GARMENT; ep |= EQP_COSTUME_GARMENT; } +} return ep; } diff --git a/src/map/script.c b/src/map/script.c index 7024c99..cae2e94 100644 --- src/map/script.c +++ src/map/script.c @@ -21798,6 +21798,115 @@ BUILDIN_FUNC(getexp2) { return SCRIPT_CMD_SUCCESS; } +/*========================================== +* Costume Items +*------------------------------------------*/ +BUILDIN_FUNC(costume) +{ + int i = -1, num, ep; + TBL_PC *sd; + + num = script_getnum(st, 2); // Equip Slot + sd = script_rid2sd(st); + + if (sd == NULL) + return SCRIPT_CMD_FAILURE; + if (equip_index_check(num)) + i = pc_checkequip(sd, equip_bitmask[num]); + if (i < 0) + return SCRIPT_CMD_FAILURE; + + ep = sd->inventory.u.items_inventory[i].equip; + if (!(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP) && !(ep&EQP_GARMENT)) { + ShowError("buildin_costume: Attempted to convert non-cosmetic item to costume."); + return SCRIPT_CMD_FAILURE; + } + log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->inventory.u.items_inventory[i]); + pc_unequipitem(sd, i, 2); + clif_delitem(sd, i, 1, 3); + // -------------------------------------------------------------------- + sd->inventory.u.items_inventory[i].refine = 0; + sd->inventory.u.items_inventory[i].attribute = 0; + sd->inventory.u.items_inventory[i].card[0] = CARD0_CREATE; + sd->inventory.u.items_inventory[i].card[1] = 0; + sd->inventory.u.items_inventory[i].card[2] = GetWord(battle_config.reserved_costume_id, 0); + sd->inventory.u.items_inventory[i].card[3] = GetWord(battle_config.reserved_costume_id, 1); + + if (ep&EQP_HEAD_TOP) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; } + if (ep&EQP_HEAD_LOW) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; } + if (ep&EQP_HEAD_MID) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; } + if (ep&EQP_GARMENT) { ep &= EQP_GARMENT; ep |= EQP_COSTUME_GARMENT; } + // -------------------------------------------------------------------- + log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->inventory.u.items_inventory[i]); + + clif_additem(sd, i, 1, 0); + pc_equipitem(sd, i, ep); + clif_misceffect(&sd->bl, 3); + + return SCRIPT_CMD_SUCCESS; +} + +/*=============================== + * getcostumeitem <item id>; + * getcostumeitem <"item name">; + *===============================*/ +BUILDIN_FUNC(getcostumeitem) +{ + unsigned short nameid; + struct item item_tmp; + TBL_PC *sd; + struct script_data *data; + + sd = script_rid2sd(st); + if (sd == NULL) + { // No player attached. + script_pushint(st, 0); + return SCRIPT_CMD_SUCCESS; + } + + data = script_getdata(st, 2); + get_val(st, data); + if (data_isstring(data)) { + int ep; + const char *name = conv_str(st, data); + struct item_data *item_data = itemdb_searchname(name); + if (item_data == NULL) + { //Failed + script_pushint(st, 0); + return SCRIPT_CMD_SUCCESS; + } + ep = item_data->equip; + if (!(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP) && !(ep&EQP_GARMENT)){ + ShowError("buildin_getcostumeitem: Attempted to convert non-cosmetic item to costume."); + return SCRIPT_CMD_FAILURE; + } + nameid = item_data->nameid; + } + else + nameid = conv_num(st, data); + + if (!itemdb_exists(nameid)) + { // Item does not exist. + script_pushint(st, 0); + return SCRIPT_CMD_SUCCESS; + } + + memset(&item_tmp, 0, sizeof(item_tmp)); + item_tmp.nameid = nameid; + item_tmp.amount = 1; + item_tmp.identify = 1; + item_tmp.card[0] = CARD0_CREATE; + item_tmp.card[2] = GetWord(battle_config.reserved_costume_id, 0); + item_tmp.card[3] = GetWord(battle_config.reserved_costume_id, 1); + if (pc_additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT)) { + script_pushint(st, 0); + return SCRIPT_CMD_SUCCESS; //Failed to add item, we will not drop if they don't fit + } + + script_pushint(st, 1); + return SCRIPT_CMD_SUCCESS; +} + /** * Force stat recalculation of sd * recalculatestat; @@ -22711,6 +22820,8 @@ struct script_function buildin_func[] = { BUILDIN_DEF(getguildalliance,"ii"), BUILDIN_DEF(adopt,"vv"), BUILDIN_DEF(getexp2,"ii?"), + BUILDIN_DEF(costume, "i"), + BUILDIN_DEF(getcostumeitem, "v"), BUILDIN_DEF(recalculatestat,""), BUILDIN_DEF(hateffect,"ii"), BUILDIN_DEF(getrandomoptinfo, "i"), diff --git a/src/map/status.c b/src/map/status.c index d5a23bb..e88c4b1 100644 --- src/map/status.c +++ src/map/status.c @@ -3407,6 +3407,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) continue; if (!sd->inventory_data[index]) continue; + if (sd->inventory.u.items_inventory[current_equip_item_index].card[0] == CARD0_CREATE && MakeDWord(sd->inventory.u.items_inventory[current_equip_item_index].card[2], sd->inventory.u.items_inventory[current_equip_item_index].card[3]) == battle_config.reserved_costume_id) + continue; base_status->def += sd->inventory_data[index]->def;
×
×
  • Create New...