Jump to content

HristDead

Members
  • Posts

    167
  • Joined

Everything posted by HristDead

  1. Nevermind, find another script that works just fine! --------------------------------------------------------------- Hi all. I'm using the script that comes along with the flux vote for point module by Jaypee. I really like how he's done the easy way to redeem items like this: add_item(ItemID,ItemQuantity,RequiredPoints,"Category"); This is easy because you don't have to make a option for every single item in the menu screen. Now my question is, I was wondering if someone could make me help this script to work with an item (ID #7227) instead of vote points. This means i don't need SQL queries or anything since i wont be using it for voting purpose, i just want it to read item id 7227 and let players pick items if they have the required amount of those, I'm merely using this script as a example. Help very much appreciated! Here is the complete script; - script - -1,{ //Function Prototypes function garbagecol;//Garbage collection for the Character variables garbagecol(); function add_item; //Syntanx: add_item(ITEMID,QUANTITY,POINTS,CATEGORY); function makeCategory;//This will return a list of the categories function getItemsByCat;//This will return the list of items associated to the particular category function getItemDetails;//This will return the details of the item function getPoints;//This will return the points of the player stored in the database function updatePoints;//This will updates the points of the player stored in the database //NPC Name set .npcname$,"[Vote Point Redeemer]"; //Initialization of the Rewards add_item(20012,1,50,"Money Cards"); add_item(20007,1,250,"Money Cards"); add_item(20008,1,500,"Money Cards"); add_item(2345,1,50,"Equipment"); add_item(2347,1,50,"Equipment"); add_item(2349,1,50,"Equipment"); add_item(2351,1,50,"Equipment"); //Script Start mes .npcname$; mes "What do you want to do?"; switch(select("Exchange my Vote Points.:Check my balance.")) { case 1: next; mes .npcname$; mes "To proceed, please select a category:"; set .@selected,select(makeCategory())-1; next; mes .npcname$; mes "Now choose the item you want:"; set .@selected,select(getItemsByCat(@listCat$[.@selected]))-1; next; mes .npcname$; set .@ritemid,getItemDetails(@itemKeys[.@selected],"itemid"); set .@rquantity,getItemDetails(@itemKeys[.@selected],"quantity"); set .@rpoints,getItemDetails(@itemKeys[.@selected],"points"); mes "Item ID:"+.@ritemid; mes "Item Name: "+getitemname(.@ritemid); mes "Item Quantity: "+.@rquantity+""; mes "Required Points: "+.@rpoints+" Vote Points"; mes "\n"; mes "Do you want to this item?"; if(select("Yes:No")==1) { set .@points,getPoints(getcharid(3)); if(.@points>=.@rpoints) { next; mes .npcname$; updatePoints(getcharid(3),.@rpoints); getitem .@ritemid,.@rquantity; mes "Here you go! Thank you for voting. Don't forget to vote again."; } else mes "Sorry, you do not have enough points for this item."; } else { next; mes .npcname$; mes "Okay bye!"; } garbagecol(); close; case 2: next; mes .npcname$; set .@points,getPoints(getcharid(3)); mes "You currently have "+.@points+" Vote Points."; garbagecol(); close; } end; //Functions Bodies function updatePoints { set .@account_id,getarg(0); set .@usedPoints,getarg(1); query_sql("UPDATE `cp_v4p_voters` SET points=(points-"+.@usedPoints+") WHERE account_id='"+.@account_id+"'"); return; } function getPoints { set .@account_id,getarg(0); query_sql("SELECT `points` FROM `cp_v4p_voters` WHERE account_id="+.@account_id+" LIMIT 1",.@points); if(getarraysize(.@points)==0) return 0; return .@points[0]; } function getItemDetails { set .@key,getarg(0); //Key set .@detail$,getarg(1); //What details to return such as ItemID, Points, Quantity, Category if(strtolower(.@detail$) == strtolower("ItemID")) return @itemID[.@key]; else if(strtolower(.@detail$) == strtolower("Quantity")) return @itemQ[.@key]; else if(strtolower(.@detail$) == strtolower("Points")) return @points[.@key]; else if(strtolower(.@detail$) == strtolower("Category")) return @category$[.@key]; } function getItemsByCat { set .@selectedCat$,getarg(0); set .@make_string$,""; set .@x,0; for(set .@i,0; .@i<getarraysize(@category$); set .@i,.@i+1) { if(strtolower(.@selectedCat$) == strtolower(@category$[.@i])) { setarray @itemKeys[.@x],.@i; if(.@make_string$ == "") set .@make_string$,getitemname(@itemID[.@i]); else set .@make_string$,.@make_string$+":"+getitemname(@itemID[.@i]); set .@x,.@x+1; } } return .@make_string$; } function makeCategory { set .@make_string$,""; for(set .@i,0; .@i<getarraysize(@category$); set .@i,.@i+1) { if(.@make_string$ == "") { setarray @listCat$[getarraysize(@listCat$)],@category$[.@i]; set .@make_string$,@category$[.@i]; } else { if(compare(.@make_string$,@category$[.@i])==0) { setarray @listCat$[getarraysize(@listCat$)],@category$[.@i]; set .@make_string$,.@make_string$+":"+@category$[.@i]; } } } return .@make_string$; } function add_item { set .@itemID,getarg(0,-1); //IteID set .@itemQ,getarg(1,-1); //Item Quantity set .@points,getarg(2,-1); set .@cat$,getarg(3,"Uncategorized"); //Category if(.@itemID == -1) { debugmes "Invalid Item ID. Script not completely loaded."; end; } else if(.@itemQ == -1) { debugmes "Invalid Item Quantity. Script not completely loaded."; end; } else if(.@points == -1) { debugmes "Points assignment error. Script not completely loaded."; end; } set .@key,getarraysize(@itemID); setarray @itemID[.@key],.@itemID; setarray @itemQ[.@key],.@itemQ; setarray @points[.@key],.@points; setarray @category$[.@key],.@cat$; return 1; //return 1 as success } function garbagecol{ deletearray @itemID[0],128; deletearray @itemQ[0],128; deletearray @points[0],128; deletearray @category$[0],128; deletearray @listCat$[0],128; deletearray @itemKeys[0],128; return; } }
  2. Thank you so much!
  3. Hi rAthena. I remember i played on a server and the equips that were dropped by monsters, were dropped already identified. For example, valkyrie dropped "Valkyrie Shield" with its appropiate sprite and ready to be equipped, instead of a guard sprite that says "Shield" and can't be equipped until using a magnifier. Does anyone know how to do this? I've checked the configs already but i can't seem to find it, maybe i'm overlooking it? Thanks
  4. Hi rAthena, I'm using the default warper but I have a problem. I added a pvp option which works fine, but my question is, how do i let it de-buff when a player warps? i know it's a command with sc_end sc_ALL; but in this script, where do i place it? Pvp: menu "(PVP) Battle Arena [^0000FF"+getmapusers("guild_vs3")+"^000000]",PVP1,"(GVG) War Zone [^0000FF"+getmapusers("guild_vs1")+"^000000]",PVP2; PVP1: Go("guild_vs3",0,0); PVP2: Go("guild_vs1",0,0); Thank you! Got it, nvm. ^^
  5. Works, thank you!
  6. Hi. After having alot of help i finally got a disguise event working. Now i ran into one little problem which i hope can be fixed easily... at the end of the event the uses npctalk twice ("Thank you all for playing......."), while in the script i can only find that line once. how can i make this line only run once? Here is the script. Thank you, help much appreciated!
  7. I tried this. Emistry NPC not clickable. did i do something wrong? //===== rAthena Script ======================================= //= Card Removal NPC //===== By: ================================================== //= TyrNemesis^ //===== Current Version: ===================================== //= 1.2 //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= //= Removes cards from equipped items. //===== Additional Comments: ================================= //= 1.0 First version. [TyrNemesis^] //= 1.2 Optimized and fixed getequipname menu. [Kisuka] //============================================================ harmonia,173,71,2 script Card Remover#eAcustom 532,{ set .#CASHPOINTS,3; // Set base cost in #CASHPOINTS of the card remover services set .percardcost,500000; // set cost per card of the card remover services set .faildestroy,0; // Should the card remover have a chance of failure that destroys items? 1 = Yes, 0 = No. mes "[Card Remover]"; mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?"; next; switch(select("Yes, it does.:What do you charge?:No thanks.")) { case 1: mes "[Card Remover]"; mes "Very well. Which item shall I examine for you?"; next; setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; set .@menu$,""; for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { if( getequipisequiped(.@i) ) set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; set .@menu$, .@menu$ + ":"; } set .@part,select(.@menu$); if(!getequipisequiped(.@part)) { mes "[Card Remover]"; mes "You're not wearing anything there that I can remove cards from."; close; } if(getequipcardcnt(.@part) == 0) { mes "[Card Remover]"; mes "There are no cards compounded on this item. I can do nothing with it, I'm afraid."; close; } set .@cardcount,getequipcardcnt(.@part); if (!checkweight(1202,(.@cardcount+1))) { mes "^3355FFJust a minute!"; mes "I can't offer any of my"; mes "services to you because"; mes "you're carrying too much"; mes "stuff. Put your extra items in"; mes "Kafra Storage and come again~"; close; } mes "[Card Remover]"; mes "This item has " + .@cardcount + "cards compounded on it. To perform my magic, I will need " + (.#CASHPOINTS+(.@cardcount * .percardcost)) + " ^0000FF3 Cash Points^000000 a ^0000FFStar Crumb^000000, and a ^0000FFYellow Gemstone^000000."; next; if(select("Very well. Do it.:Nevermind.") == 2) { mes "[Card Remover]"; mes "Very well. Return at once if you seek my services."; close; } if((#CASHPOINTS < (.#CASHPOINTS+(.@cardcount * .percardcost))) || (countitem(1000) < 1) || (countitem(715) < 1)) { mes "[Card Remover]"; mes "You do not have all the items I require to work my magic, child. Come again when you do."; close; } mes "[Card Remover]"; mes "Before I begin, I must warn you--I may fail. If I do, I may destroy the cards, the item, or both. I do not give refunds. That being said, which is more important to you: The cards, or the item?"; next; switch(select("I changed my mind about this.:The item.:The cards.")) { case 1: mes "[Card Remover]"; mes "Very well. Return at once if you seek my services."; close; case 2: set .@failtype,1; break; case 3: set .@failtype,2; } mes "[Card Remover]"; mes "Very well. I shall begin."; set #CASHPOINTS,#CASHPOINTS - (.#CASHPOINTS+(.@cardcount * .percardcost)); // Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt // First value = Total failure chance (item and cards destroyed) // Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe) // Third value = Harmless failure chance (all that's lost is your investment) set .@failchance,rand(100); if (.faildestroy==1) { if(.@failchance < 2) { next; failedremovecards .@part,0; mes "[Card Remover]"; mes "The process was a total failure. I am afraid the item and the cards were destroyed."; close; } if(.@failchance < 8) { if (.@failtype == 1) { next; failedremovecards .@part,1; mes "[Card Remover]"; mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay."; close; } if (.@failtype == 2) { next; failedremovecards .@part,2; mes "[Card Remover]"; mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process."; close; } } } if(.@failchance < 10) { next; failedremovecards .@part,3; mes "[Card Remover]"; mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay."; close; } next; successremovecards .@part; mes "[Card Remover]"; mes "The process was a success. Here are your cards and your item. Farewell."; close; case 2: mes "[Card Remover]"; mes "I charge a flat fee of "+.#CASHPOINTS+" Cash Points, plus "+.percardcost+" Zeny for each card I remove from the item."; close; case 3: mes "[Card Remover]"; mes "Very well. Return at once if you seek my services."; close; } }
  8. Hi. I'm not sure how to do this, I want the rathena default cardremover to take 3 cashpoints instead of zeny. I still want the zeny per card costs to stay though, but change the base costs with cashpoints (set .zenycost,500000; // Set base cost in zeny of the card remover services) Here is the script //===== rAthena Script ======================================= //= Card Removal NPC //===== By: ================================================== //= TyrNemesis^ //===== Current Version: ===================================== //= 1.2 //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= //= Removes cards from equipped items. //===== Additional Comments: ================================= //= 1.0 First version. [TyrNemesis^] //= 1.2 Optimized and fixed getequipname menu. [Kisuka] //============================================================ harmonia,173,71,2 script Card Remover#eAcustom 532,{ set .zenycost,500000; // Set base cost in zeny of the card remover services set .percardcost,250000; // set cost per card of the card remover services set .faildestroy,0; // Should the card remover have a chance of failure that destroys items? 1 = Yes, 0 = No. mes "[Card Remover]"; mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?"; next; switch(select("Yes, it does.:What do you charge?:No thanks.")) { case 1: mes "[Card Remover]"; mes "Very well. Which item shall I examine for you?"; next; setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; set .@menu$,""; for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { if( getequipisequiped(.@i) ) set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; set .@menu$, .@menu$ + ":"; } set .@part,select(.@menu$); if(!getequipisequiped(.@part)) { mes "[Card Remover]"; mes "You're not wearing anything there that I can remove cards from."; close; } if(getequipcardcnt(.@part) == 0) { mes "[Card Remover]"; mes "There are no cards compounded on this item. I can do nothing with it, sorry."; close; } set .@cardcount,getequipcardcnt(.@part); if (!checkweight(1202,(.@cardcount+1))) { mes "^3355FFJust a minute!"; mes "I can't offer any of my"; mes "services to you because"; mes "you're carrying too much"; mes "stuff. Put your extra items in"; mes "Kafra Storage and come again~"; close; } mes "[Card Remover]"; mes "This item has " + .@cardcount + "cards compounded on it. To perform my magic, I will need " + (.zenycost+(.@cardcount * .percardcost)) + " zeny, a ^0000FFStar Crumb^000000, and a ^0000FFYellow Gemstone^000000."; next; if(select("Very well. Do it.:Nevermind.") == 2) { mes "[Card Remover]"; mes "Very well. Return at once if you seek my services."; close; } if((zeny < (.zenycost+(.@cardcount * .percardcost))) || (countitem(1000) < 1) || (countitem(715) < 1)) { mes "[Card Remover]"; mes "You do not have all the items I require to work my magic, child. Come again when you do."; close; } mes "[Card Remover]"; mes "Before I begin, I must warn you--I may fail. If I do, I may destroy the cards, the item, or both. I do not give refunds. That being said, which is more important to you: The cards, or the item?"; next; switch(select("I changed my mind about this.:The item.:The cards.")) { case 1: mes "[Card Remover]"; mes "Very well. Return at once if you seek my services."; close; case 2: set .@failtype,1; break; case 3: set .@failtype,2; } mes "[Card Remover]"; mes "Very well. I shall begin."; set zeny,zeny - (.zenycost+(.@cardcount * .percardcost)); // Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt // First value = Total failure chance (item and cards destroyed) // Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe) // Third value = Harmless failure chance (all that's lost is your investment) set .@failchance,rand(100); if (.faildestroy==1) { if(.@failchance < 2) { next; failedremovecards .@part,0; mes "[Card Remover]"; mes "The process was a total failure. I am afraid the item and the cards were destroyed."; close; } if(.@failchance < 8) { if (.@failtype == 1) { next; failedremovecards .@part,1; mes "[Card Remover]"; mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay."; close; } if (.@failtype == 2) { next; failedremovecards .@part,2; mes "[Card Remover]"; mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process."; close; } } } if(.@failchance < 10) { next; failedremovecards .@part,3; mes "[Card Remover]"; mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay."; close; } next; successremovecards .@part; mes "[Card Remover]"; mes "The process was a success. Here are your cards and your item. Farewell."; close; case 2: mes "[Card Remover]"; mes "I charge a flat fee of "+.zenycost+" zeny, plus "+.percardcost+" zeny for each card I remove from the item."; close; case 3: mes "[Card Remover]"; mes "Very well. Return at once if you seek my services."; close; } }
  9. Thanks thanks thanks! This works.
  10. Still not working. It's either both NPCs work and i can keep walking between them getting items from both, or only one works and the other brings me to the 'quest done' variable without completing the quest.
  11. thanks emistry, where do i place that line? do i need to edit anything else on the scripts?
  12. It's not working, sadly. Any other ideas?
  13. I don't know how to do this in rA, in eA it worked like this: if(quest_done == 1) { mes "Text here if quest succeeded."; close; } next; getitem 12157,1; getexp 150,15; next; mes "Text here if quest done"; set quest_done,1; close; } That would be a unrepeatable quest, when you wanted another unrepeatable quest it was copying the whole thing and simply changing the 1 into a 2. But if i do that now, i can keep running in between two NPCs and they will keep giving me items and exp, so it's not unrepeatable at all. how can i make it unrepeatable...? Help very much appreciated!
  14. Solved!
  15. How about the timer? if i do it like that it won't communicate well with my broadcasting. I don't want it to spawn until "sleep2 20000;" after characters enter the map, just like this part of my script: OnInIt: sleep2 20000; monster "2@nyd",200,345,"Nidhoggr's Shadow",2022,1,strnpcinfo(0)+"::OnMobDead"; end; is that possible to imply in your script?
  16. Thanks emistry, but I only want it to spawn as soon as a player enters. my script includes some broadcasting which I've cut out since i dont think its neccesary, and as of now, nid spawns exactly when my broadcast ends and i kinda want to keep it like that. it works perfectly fine the first player/party to enter, I want it to repeat that process so when another player enters the map the same happens. sorry i hope you understand. i'm not good in explaining.
  17. Thanks Emistry
  18. I don't know, and i figured it's not just this script. It's every disguise script including the one by GmOcean one that comes with the latest rAthena. I wonder why Masao's works though...
  19. I've tried that one but it doesn't work thats why I went with Masao's. Same story, NPC isn't clickable, maybe my revision isn't reading the functions properly or something...
  20. Done that, not clickable and the NPC doesn't disguise.
  21. Hello, i had a question I was wondering how to make pets loyal right after capturing them... I've figured out how to make the hungry delay take forever but this one seems more difficult... does anyone know?
  22. The map server is not showing errors and the event starts just fine, but the NPC isn't clickable and doesn't disguises at all, it just broadcasts every few seconds "no one knew the answer" while he didnt disguise.
  23. Cannot click the NPC. >.<
  24. No error at all. it's like nothing changed compared to the authors original version
×
×
  • Create New...