Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Community Answers

  1. Kurofly's post in need help cant move or do anything after login was marked as the answer   
    If your server doesn't return any error it probably means it froze. If it did freeze normally you should still be able to open your iventory, item description etc.. Also when you disconnect the char serv doesn't notify you.
    Make sure whether that's the case and if it is, that's most likely a database problem.
    What database are You using? Did you update it properly?. Since you tried different servers you might have conflicts in their databases. If that's the case you have no choice but to delete it completely and install it again.
    Don't rush into this if you're not sure your server is freezing. I'm on my phone now so I can't give you more détails but I'll post some more info this evening especially about uninstalling your database.
    Keep going!
  2. Kurofly's post in [NPC Timer] ! was marked as the answer   
    Like this
    //On<weekday><hour><minute> OnMon0800: // monday 8 am OnFri0800: // friday 8 am
  3. Kurofly's post in [Gm & Player Respond] was marked as the answer   
    I don't have the pvp_y_<x>-5 maps, I can't test it.
     
    What's the error? If there's no error what doesn't work?
     
    Full starter:
    //Counts down and starts race pvp_y_1-5,145,269,5 script Starter 733,{ if ($@race != 0) goto L_Started; if ($@counting != 0) goto L_Started; if ($@racecount == 1) goto L_Started; L_Menu: mes "[Race Starter]"; mes "Please stay on the Eastern side of me."; // menu "Start Race",L_Count,"Cancel",-; if (getgmlevel() >= 80) menu "Start Race",L_Count,"Cancel",-; close; L_Count: set $@counting,1; mes "Counting down..."; addtimer 1000, "Starter::OnCount1000"; addtimer 2000, "Starter::OnCount2000"; addtimer 3000, "Starter::OnCount3000"; addtimer 4000, "Starter::OnCount4000"; announce strcharinfo(0) + "Started a countdown",1; announce "Get ready to race!",1; close; OnCount1000: announce "[3]",1; end; OnCount2000: announce "[2]",1; end; OnCount3000: announce "[1]",1; end; OnCount4000: emotion e_go; specialeffect EF_CHIMTO; announce "[GO!]",1; set $@race,1; set $@position,0; set $@counting,0; set $@raceid,rand(100000,999999); end; L_Started: if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu; if ($@position > 2) goto L_Menu; mes "[Starter]"; mes "Race in progress"; close; OnInit: set $@race,0; set $@position,0; set $@racecount,0; end; }
  4. Kurofly's post in color code to this menu was marked as the answer   
    Then it'd go like this
    set .@menu$, ""; for(set .@j,1; .@j<5; set .@j,.@j+1) { -- if (.@Items[.@j] != .@i) set .@menu$, .@menu$+getitemname(.@Items[.@j]); ++ if (.@Items[.@j] != .@i) set .@menu$, .@menu$+"^ff0000"+getitemname(.@Items[.@j])+"^000000"; set .@menu$, .@menu$+":"; } set .@menu$, .@menu$+"Cancel"; set .@j, select(.@menu$);
  5. Kurofly's post in Request Newbie Instructor NPC was marked as the answer   
    Hi
     
    here's your script
    <map>,<x>,<y>,<pos> script <name of your npc> <sprite id>,{ .@name$ = "[^0066ff"+strnpcinfo(0)+"^000000]"; if (ExpBonusGiven) { mes .@name$,"I already gave you a bonus, can't give you more!" ; close; } if (BaseLevel >= 75) { mes .@name$,"Sorry but I'm not allowed to give exp boost to players level 75 or higher!" ; close; } mes .@name$,"Hello there, since you are under level 75 I can give you an exp bonus for the next 24 hours." ; next; mes .@name$,"Do you want to enable the exp bonus now?"," ~ ^0000fflasts 24 hours^000000"," ~ ^ff0000only available under the level 75^000000" ; next; if (select("Not now:Sure I want!") == 1) close; ExpBonusGiven = 1; sc_start SC_EXPBOOST,24*60*60*1000,400; mes .@name$,"There you go, make good use of that bonus!"; close; } If you need anything else, you now where to ask 
     
    Welcome to rAthena! Glad to see a new face here (too many oldies there ^^)
  6. Kurofly's post in Executing script from src was marked as the answer   
    You could add an event label and then call it when opening the shop.
     
     
    Let's say you want to create a label named 'OnCashShopOpening' (yeah should think about something else ^^)
     
    src/map/npc.c :
    void npc_read_event_script(void) { int i; struct { char *name; const char *event_name; } config[] = { {"Login Event",script_config.login_event_name}, {"Logout Event",script_config.logout_event_name}, {"Load Map Event",script_config.loadmap_event_name}, {"Base LV Up Event",script_config.baselvup_event_name}, {"Job LV Up Event",script_config.joblvup_event_name}, {"Die Event",script_config.die_event_name}, {"Kill PC Event",script_config.kill_pc_event_name}, {"Kill NPC Event",script_config.kill_mob_event_name}, {"Stat Calc Event",script_config.stat_calc_event_name}, ++ {"Cash Shop Event",script_config.cash_shop_event_name}, };  src/map/npc.h :
    //Script NPC events. enum npce_event { NPCE_LOGIN, NPCE_LOGOUT, NPCE_LOADMAP, NPCE_BASELVUP, NPCE_JOBLVUP, NPCE_DIE, NPCE_KILLPC, NPCE_KILLNPC, NPCE_STATCALC, ++ NPCE_CASHSHOP, NPCE_MAX };  src/map/script.c :
    struct Script_Config script_config = { 1, // warn_func_mismatch_argtypes 1, 65535, 2048, //warn_func_mismatch_paramnum/check_cmdcount/check_gotocount 0, INT_MAX, // input_min_value/input_max_value "OnPCDieEvent", //die_event_name "OnPCKillEvent", //kill_pc_event_name "OnNPCKillEvent", //kill_mob_event_name "OnPCLoginEvent", //login_event_name "OnPCLogoutEvent", //logout_event_name "OnPCLoadMapEvent", //loadmap_event_name "OnPCBaseLvUpEvent", //baselvup_event_name "OnPCJobLvUpEvent", //joblvup_event_name "OnPCStatCalcEvent", //stat_calc_event_name "OnTouch_", //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves) "OnTouch", //ontouch2_name (run whenever a char walks into the OnTouch area) ++ "OnCashShopOpening", };  src/map/script.h :
    extern struct Script_Config { unsigned warn_func_mismatch_argtypes : 1; unsigned warn_func_mismatch_paramnum : 1; int check_cmdcount; int check_gotocount; int input_min_value; int input_max_value; const char *die_event_name; const char *kill_pc_event_name; const char *kill_mob_event_name; const char *login_event_name; const char *logout_event_name; const char *loadmap_event_name; const char *baselvup_event_name; const char *joblvup_event_name; const char *stat_calc_event_name; const char* ontouch_name; const char* ontouch2_name; ++ const char* cash_shop_event_name; } script_config; src/map/clif.c
    void clif_parse_cashshop_open_request( int fd, struct map_session_data* sd ){ sd->npc_shopid = -1; // Set npc_shopid when using cash shop from "cash shop" button [Aelys|Susu] bugreport:96 clif_cashshop_open( sd ); ++ npc_script_event(sd, NPCE_CASHSHOP); }  In any npc:
    - script dubnpc -1,{ OnCashShopOpening: debugmes "it works!!"; end; }  Tested and working
     

     
    I don't know if there's a way to call a specific npc event or even to call a script function, sorry but I don't know much about src at all so that's all I've got.
  7. Kurofly's post in Request < NPC For Leveling room with Restrictions was marked as the answer   
    There you go
    pallene,164,145,5 script Leveling Room 84,{ .@name$ = "[^0066ffLeveling Room^000000]"; mes .@name$,"Gnar Gnar Gnar..." ; next; mes .@name$,"I can bring you to a place where you can gain levels a easy way.."; mes "what do i get in return? well when choosing this way of levelling.. it shows that youre are weak!"; mes "and thats something I love!" ; next; mes .@name$,"In order to get you there, it will cost you:"; mes " ~ 300 <ITEMLINK>"+getitemname(7227)+"<INFO>"+7227+"</INFO></ITEMLINK>"; //mes " ~ 300 "+getitemname(7227); // in case the item link is not available in your client mes " ~ 500 000 zeny"; mes " Minimum Level required: 150"; next; if (select("Proceed:Leave") == 2) end; if (countitem(7227) < 300 || Zeny < 500000 || BaseLevel < 150) { mes .@name$,"come again when you decide to let the shadow realm inside youre head Muahahah~" ; close; } mes .@name$,"Goood... Let the ShadowRealm take you there so you can start leveling the weak way!"; mes "but remember.... if you die.... you will have to bring me the money and the cards all over..."; mes "Still want to go?"; if (select("Yes because I'm weak!:No leave me alone!") == 2) end; delitem 7227,300; Zeny -= 500000; warp "pvp_y_1-2",0,0; end; OnInit: monster "pvp_y_1-2",0,0,"Leveling Barricade",1905,50,"Leveling Room::OnLevelUp"; monster "pvp_y_1-2",0,0,"Leveling Barricade",1905,50,"Leveling Room::OnLevelUp"; monster "pvp_y_1-2",0,0,"Leveling Barricade",1905,50,"Leveling Room::OnLevelUp"; monster "pvp_y_1-2",0,0,"Leveling Barricade",1905,50,"Leveling Room::OnLevelUp"; monster "pvp_y_1-2",0,0,"Leveling Barricade",1905,50,"Leveling Room::OnLevelUp"; end; OnLevelUp: atcommand "@blvl 5"; atcommand "@jlvl 5"; end; } I'm a bit in a rush so I didn't had any color. It's pretty basic don't hesitate to add a bit of colors or anything.
     
    Gotta go! 
  8. Kurofly's post in how to change item script was marked as the answer   
    Can't you just change the item type and add a script??
    7539,Poring_Coin,Poring Coin,3,0,,0,,,,,,,,,,,,,{},{},{} remplace to
    7539,Poring_Coin,Poring Coin,2,0,,0,,,,,,,,,,,,,{#CASHPOINTS++;},{},{} And if you want to put restrictions:
    Say thanks to the wiki 
  9. Kurofly's post in Browedit sanity error : invalid water type was marked as the answer   
    Thanks for answering so fast (not like me ;p)
     
    I tried downloading a few ressources from here especially the water map pack following these steps but I can't manage to solve it.
    A actually didn't notice untill now but the water textures aren't showing in game ^^
     
    I'll keep trying.

    ----------------------------------
     
    Ok I managed to make it work (in game too)
     
    I lacked the water map pack to load the water textures and I still needed to set the water count to 19 in ro.xml and rodesktop.xml (I did it only in rocheaptop.xml) in order to be able to load the map with browedit.
     
    Thanks for your help, I didn't think I was missing files since I thought browedit would tell me something like 'couldn't find ...'. Without this I wouldn't have been able to guess!
  10. Kurofly's post in packet 0xa39 was marked as the answer   
    Set your packet_db version to 55
     
    In db/packet_db.txt
     
    Define packet obfuscation
     
    in src/config/core.h
     
    Recompile
     
    Set your clientinfo version to 55
     
     in clientinfo.xml
     
    And diff your ragexe without checking the disable packet encryption option
     

  11. Kurofly's post in need help+Questions was marked as the answer   
    When you downloaded your server folder you normally used either toirtoiseGit or TortoiseSVN.
     
    If you used toirtoise git you need to do right click > tortoise git > Pull...
     
    If you used tortoise svn you need to do right click > SVN Update
  12. Kurofly's post in monster game id on death was marked as the answer   
    Ahhh, ok I'm an idiot ^^
     
    There it goes:
    if( md->npc_event[0] && !md->state.npc_killmonster ) { if( sd && battle_config.mob_npc_event_type ) { ++ pc_setglobalreg(sd, add_str("killedgid"), md->bl.id); pc_setparam(sd, SP_KILLEDRID, md->mob_id); pc_setparam(sd, SP_KILLERRID, sd->bl.id); npc_event(sd,md->npc_event,0); } else if( mvp_sd ) { ++ pc_setglobalreg(mvp_sd, add_str("killedgid"), md->bl.id); pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id); pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0); npc_event(mvp_sd,md->npc_event,0); } else npc_event_do(md->npc_event); } else if( mvp_sd && !md->state.npc_killmonster ) { ++ pc_setglobalreg(mvp_sd, add_str("killedgid"), md->bl.id); pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id); npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance] }  (edited to fit the latest revision)
     
    working perfectly.
     
    Thanks a lot for this, I'll make good use of that game id 
  13. Kurofly's post in checkquest playtime was marked as the answer   
    try to create a quest which has a short time limit and complete it. Once you reach the time limit check it again and you'll know.
     
    It all depends on wether the timer is deleted upon completion or not, if I were to one who created it I would delete the timer since it would be useless to continue running it.
  14. Kurofly's post in Set a player's lvl only in one map? was marked as the answer   
    If you don't mind, can I ask you two questions? ^^
     
    Why do you use a function for setting the level back to normal?
    Why don't you replace this
    if( !compare( implode( .maps$, ":" ), .@map$ ) ) end; by this?
    if( !compare( implode( .maps$, ":" ), .@map$ ) ) { callfunc( "PVPLP_revertLevel" ) ; end;} so that players can get their level back when they leave the map instead of having to disconnect.
     
    Also make sure players loose their stat points when their level is set to a lower value because I don't think it recalculates it automatically.
  15. Kurofly's post in (SQL_QUERY) Update existing data was marked as the answer   
    Do you want the donations to be displayed with an alphabetical order or the highest/lowest donation first?
    nevermind didn't see what you wrote at the bottom..
     
    Alphabetical order:
    query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `name`", .@donor_name$, .@donate_amount; Lowest first:
    query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `donateamount`", .@donor_name$, .@donate_amount; Highest first:
    query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `donateamount` DESC", .@donor_name$, .@donate_amount; For the update thing when you want to save the donations do something like this
    .@n = query_logsql ("SELECT `donateamount` FROM `donornames` WHERE `<your primary key>` = '<value to compare>'",.@donate_amount); if (.@n == -1) query_logsql ("INSERT INTO `donornames` (...) VALUES (...)"); else query_logsql ("UPDATE `donornames` SET `donateamount` = '"+(.@donate_amount+<amount of points to add>)+"' WHERE `<your primary key>` = '<value to compare>'");
  16. Kurofly's post in Help SQL DB error Ragnarok interreg doesn't exist was marked as the answer   
    weird. Can you show us your sql query?
     
    did you write `ragnarok`.`interreg` ?
     
    Check your mysql workbench to make sure you have that table.
  17. Kurofly's post in NPC just a click away was marked as the answer   
    Server-Side:
     
    The shop (put it in a script file)
    - shop myshopname -1,512:-1,513:-1,514:-1 don't forget to put the items you want to sell and their prices
     
    The item:
    <ID>,My_Item_Name,My Item Name,2,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{callshop "myshopname",1;},{},{} Client-Side:
     
    newer than 2012-04-10a:
    iteminfo.lub:
    [<ID>] = { unidentifiedDisplayName = "My Item Name", unidentifiedResourceName = "Ä«ÇÁ¶óÀÌ¿ë±Ç", unidentifiedDescriptionName = { "Opens a shop.", "", "Weight: ^7777771^000000" }, identifiedDisplayName = "My Item Name", identifiedResourceName = "Ä«ÇÁ¶óÀÌ¿ë±Ç", identifiedDescriptionName = { "Opens a shop.", "", "Weight: ^7777771^000000" }, slotCount = 0, ClassNum = 0 }, older than 2012-04-10a:
    idnum2itemdesctable.txt:
    <ID># Opens a shop. Weight: ^7777771^000000 # idnum2itemdisplaynametable.txt:
    <ID>#My Item Name# idnum2itemresnametable.txt
    <ID>#Ä«ÇÁ¶óÀÌ¿ë±Ç# Don't forget to edit the id and item name in all files
  18. Kurofly's post in Healer Request was marked as the answer   
    amatsu,235,237,4 script healer 925,{ end; OnInit: freeloop(1); getmapxy( .m$, .x, .y, 1, strnpcinfo(0) ); OnTimer5000: initnpctimer; addrid( 4, 0, .x-15, .y-15, .x+15, .y+15 ); if( playerattached() ) { getinventorylist; .@len = @inventorylist_count; copyarray .@inventorylist_id, @inventorylist_id, .@len; copyarray .@inventorylist_identify, @inventorylist_identify, .@len; for ( .@j = 0; .@j < .@len; .@j++ ) { if ( !.@inventorylist_identify[.@j] ) { delitem2 .@inventorylist_id[.@j], 1, 0, 0, 0, 0, 0, 0, 0; getitem .@inventorylist_id[.@j], 1; } } if( HP < MAXHP ) { specialeffect2 EF_HEAL2; percentheal 100, 100; } repairall; } } I have this in stock, I never used it and I don't even know who it belongs to xD
     
    It'll heal, identify, repair all players around it every 5 seconds

    oh sry I forgot blessing and agi
    amatsu,235,237,4 script healer 925,{ //30 32 end; OnInit: freeloop(1); getmapxy( .m$, .x, .y, 1, strnpcinfo(0) ); OnTimer5000: initnpctimer; addrid( 4, 0, .x-15, .y-15, .x+15, .y+15 ); if( playerattached() ) { getinventorylist; .@len = @inventorylist_count; copyarray .@inventorylist_id, @inventorylist_id, .@len; copyarray .@inventorylist_identify, @inventorylist_identify, .@len; for ( .@j = 0; .@j < .@len; .@j++ ) { if ( !.@inventorylist_identify[.@j] ) { delitem2 .@inventorylist_id[.@j], 1, 0, 0, 0, 0, 0, 0, 0; getitem .@inventorylist_id[.@j], 1; } } if( HP < MAXHP ) { specialeffect2 EF_HEAL2; percentheal 100, 100; } if (!getstatus(30)) sc_start 30,240000,10; if (!getstatus(32))sc_start 32,240000,10; repairall; } }
  19. Kurofly's post in Show who's online was marked as the answer   
    set .@size, query_sql( "SELECT `name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `group_id` > 0 ) ORDER BY `name` DESC LIMIT 128", .@name$ ); there is no column 'level' in the login table, you probably mean 'group_id'.
    Didn't try it but it seems ok
  20. Kurofly's post in R> Dynamic Weather Prontera? was marked as the answer   
    - script weather npc -1,{ function ChangeWeather ; function CheckMap ; function CheckBound; OnInit: //==================================== *user setup* =================================================== setarray .maps$ , "prontera","morocc"; //place the maps you want the weather to be enabled here .mapcount = getarraysize(.maps$); setarray .weathers$ , "clouds","clouds2","fireworks","fog","leaves","sakura","snow"; .weathercount = getarraysize(.weathers$); .delay = 1; //will change the weather every <.delay> minutes //================================= *end of user setup*================================================ bindatcmd "weather",strnpcinfo(0)+"::OnWeather",40; initnpctimer; end; OnTimer60000: $WeatherTimer++; if ($WeatherTimer >= .delay) { $WeatherTimer = 0 ; ChangeWeather(); } //changing weather.. end; OnHour18: for (.@i = 0 ; .@i < .mapcount ; .@i++) setmapflag .maps$[.@i],mf_nightenabled; end; OnHour08: for (.@i = 0 ; .@i < .mapcount ; .@i++) removemapflag .maps$[.@i],mf_nightenabled; end; OnWeather: $WeatherTimer = 0; ChangeWeather(); end; function ChangeWeather { //change weather .@weather$ = getvariableofnpc(.weathers$[rand(getvariableofnpc(.weathercount,"weather npc"))],"weather npc"); while (.@weather$ == getvariableofnpc(.prev_weather$,"weather npc")) .@weather$ = getvariableofnpc(.weathers$[rand(getvariableofnpc(.weathercount,"weather npc"))],"weather npc"); for (.@i = 0 ; .@i < getvariableofnpc(.mapcount,"weather npc") ; .@i++) { if (getvariableofnpc(.prev_weather$,"weather npc") != "") removemapflag getvariableofnpc(.maps$[.@i],"weather npc"),getd("mf_"+getvariableofnpc(.prev_weather$,"weather npc")); setmapflag getvariableofnpc(.maps$[.@i],"weather npc"),getd("mf_"+.@weather$); } set getvariableofnpc(.prev_weather$,"weather npc") , .@weather$; //reload screen for players not selling/in chatroom .@n = query_sql ("SELECT `name` FROM `char` WHERE `online` = 1",.@players$); for (.@i = 0 ; .@i < getarraysize(.@players$) ; .@i++) { if (attachrid(getcharid(3,.@players$[.@i]))) { getmapxy .@map$,.@x,.@y,0; if (CheckMap(.@map$) && CheckBound()) warp .@map$,.@x,.@y; } } return; } function CheckMap { getmapxy .@map$,.@x,.@y,0; for (.@i = 0 ; .@i < getvariableofnpc(.mapcount,"weather npc") ; .@i++) if (.@map$ == getvariableofnpc(.maps$[.@i],"weather npc")) return 1; return 0; } function CheckBound { if (checkchatting(strcharinfo(0)) || checkvending(strcharinfo(0))) return 0; return 1; } } Check out the user setup.
     
    The weather will be changed on the maps in .maps$ array every <.delay> minutes.
    I put all the weathers in the .weathers$ array but you can delete some if you want
     
    night mode will be activated from 6pm to 8am but you can change those if you want (just change OnHour18 to OnHour19 for example)
     
    players who are not vending or in a chatroom will be warped to their current location to reload their screens so that they can see the effects.
     
    Tell me if you want to add/change anything
  21. Kurofly's post in Need Help with this Simple Script was marked as the answer   
    if(countitem(4052)<1|| countitem(2607)<1 || countitem(7277)<50 || countitem(592)<1 || Zeny < 1000000) goto L_NoMake; Some ')' not at the right places
  22. Kurofly's post in Party Quest Delay was marked as the answer   
    Ahh ok I get it.
    set .@rid , getcharid(3,strcharinfo(0)); addrid (2,0,getcharid(1)); //attach the rid of all players in the group set questdelay,gettimetick(2)+10800; //set the delay for all players in group detachrid; attachrid(.@rid); //so that the rest of the script will only run on the party leader
  23. Kurofly's post in item Script was marked as the answer   
    bonus2 bAddRace,RC_NonBoss,<value> ?
    For demi-humain use the same with all races except demi-human
  24. Kurofly's post in Advanced refiner issue was marked as the answer   
    Guess that's how it should be:
    //<?> -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o \\ // Blacksmith/Card Removal Npc V.2.0 \\ // by Luther \\ //<?> -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o \\ // Blacksmith/Card Removal Npc V.2.0 \\ // by Luther \\ // Credit To : Mytzer,TyrNemisis,ShadowMaster and \\ // who ever made the Item Identifyer Deckard Cain. \\ // Whoms Scripts were used in making this npc. \\ // Also ToastOfDoom and Chachi911 for helping Debug it\\ // (V.2.0 Uses the original eAthena Refine Script that\\ //can have its rates configured in the refine_db.txt) \\ // -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o \\ prontera,166,231,3 script Refiner 85,{ set .soundef_number, .soundef_number + 1; switch (.soundef_number) { case 1: soundeffect "hollen2.wav",0; break; case 2: soundeffect "hollen3.wav",0; break; case 3: soundeffect "hollen4.wav",0; break; case 4: soundeffect "hollen5.wav",0; break; } if (.soundef_number >= 3) { set .soundef_number, 0; } end; callfunc "refinemainx","Advanced Hollgrehenn",1; end; } //============================================================ //= Main Refiner Function //============================================================ //= To allow auto safe refining/multiple refining set the //= 0 after Melchior to '1' in the function call. //= To Change the Name of the NPC, just Edit it in the //= Beginning of the Script and the Melchior part of the //= Call function. //============================================================ function script refinemainx { set .@features,getarg(1); mes "[" + getarg(0) + "]"; mes "I can Refine, Extract Cards, Identify Items, and Repair Broken Items ^FF0000which of my services are you interested in?^000000"; menu "Refining",L_Refine,"Item Repair",L_Repair; L_Refine: mes "refining eh?"; next; mes "[" + getarg(0) + "]"; mes "I can refine all kinds of weapons, armor and equipment, so let me"; mes "know what you want me to refine."; 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 "[" + getarg(0) + "]"; mes "You're not wearing"; mes "anything there that"; mes "I can refine."; emotion 6; close; } //Check if the item is refinable... if(!getequipisenableref(.@part)) { mes "[" + getarg(0) + "]"; mes "I don't think I can"; mes "refine this item at all..."; close; } //Check if the item is identified... (Don't know why this is in here... but kept it anyway) if(!getequipisidentify(.@part)) { mes "[" + getarg(0) + "]"; mes "You can't refine this"; mes "if you haven't appraised"; mes "it first. Make sure your"; mes "stuff is identified before"; mes "I can refine it."; close; } //Check to see if the items is already +10 if(getequiprefinerycnt(.@part) >= 10) { mes "[" + getarg(0) + "]"; mes "I can't refine this"; mes "any more. This is as"; mes "refined as it gets!"; close; } set .@refineitemid, getequipid(.@part); // save id of the item set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count switch(getequipweaponlv(.@part)){ case 0: //Refine Armor set .@price,2000; set .@material,985; set .@safe,4; break; case 1: //Refine Level 1 Weapon set .@price,50; set .@material,1010; set .@safe,7; break; case 2: //Refine Level 2 Weapon set .@price,200; set .@material,1011; set .@safe,6; break; case 3: //Refine Level 3 Weapon set .@price,5000; set .@material,984; set .@safe,5; break; case 4: //Refine Level 4 Weapon set .@price,20000; set .@material,984; set .@safe,4; break; case 5: //Refine other stuff? set .@price,2000; set .@material,985; set .@safe,4; break; } if(.@features != 1) { mes "[" + getarg(0) + "]"; mes "To refine this I need"; mes "one ^003366"+getitemname(.@material)+"^000000 and"; mes "a service fee of " + .@price + " Zeny."; mes "Do you really wish to continue?"; next; if(select("Yes:No") == 2){ mes "[" + getarg(0) + "]"; mes "Yeah..."; mes "There's no need to"; mes "rush. Take your time."; close; } if(getequippercentrefinery(.@part) < 100) { mes "[" + getarg(0) + "]"; mes "Oh no! If I continue to"; mes "refine this, there's a risk it could"; switch(.@material) { case 985: mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000."; break; default: mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,"; mes "or any added special properties."; break; } next; mes "["+getarg(0)+"]"; mes "I can't make it any clearer."; mes "Once a weapon is destroyed,"; mes "there's no getting it back."; mes "You really have a chance to"; mes "^FF0000lose this weapon^000000 forever."; mes "Do you still want to refine?"; next; if(select("Yes:No") == 2){ mes "[" + getarg(0) + "]"; mes "I completely agree..."; mes "I might be a great refiner, but sometimes even I make mistakes."; close; } } if((countitem(.@material) < 1) || (Zeny < .@price)) { mes "[" + getarg(0) + "]"; mes "You don't seem to have"; mes "enough Zeny or "+getitemname(.@material)+"..."; mes "Go get some more. I'll be"; mes "here all day if you need me."; close; } set Zeny,Zeny-.@price; delitem .@material,1; if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?) mes "[" + getarg(0) + "]"; mes "Look here... you don't have any Items on..."; close; } if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item mes "[" + getarg(0) + "]"; Emotion e_an; mes "Wait a second..."; mes "Do you think I'm stupid?!"; mes "You switched the item while I wasn't looking! Get out of here!"; close; } if(getequippercentrefinery(.@part) <= rand(100)) { failedrefitem .@part; mes "[" + getarg(0) + "]"; set .@emo,rand(1,5); if (.@emo == 1) { Emotion e_cash; } else { Emotion e_swt; } set .@lose,rand(1,3); if (.@lose == 1) { mes "OH! MY GOD!"; mes "Damn it! Not again!"; mes "I'm terribly sorry, but you know practice does make perfect."; mes "Um, right? Heh heh..."; } else if(.@lose == 2) { mes "Nooooooo!"; mes "It broke!"; mes "I-I'm sorry!"; } else { mes "Crap!"; mes "It couldn't take"; mes "much more tempering!"; mes "Sorry about this..."; } close; } mes "["+getarg(0)+"]"; successrefitem .@part; Emotion e_heh; set .@win,rand(1,3); if (.@win == 1) { mes "Perfect!"; mes "Heh heh!"; mes "Once again,"; mes "flawless work"; mes "from the master~"; } else if(.@win == 2) { mes "Success...!"; mes "Yet again, my amazing"; mes "talent truly dazzles"; mes "and shines today."; } else { mes "Heh heh!"; mes "I'm all done."; mes "No doubt, my work is"; mes "to your satisfaction."; mes "Sheer, utter perfection~"; } close; } // New Refining Functions ======================== if(getequiprefinerycnt(.@part) < .@safe) { mes "[" + getarg(0) + "]"; mes "I can refine this to the safe limit or a desired number of times... it's your choice..."; next; set .@menu2,select("To the safe limit please.","I'll decide how many times.","I've changed my mind..."); } else set .@menu2,2; switch(.@menu2){ case 1: set .@refinecnt,.@safe - getequiprefinerycnt(.@part); break; case 2: next; mes "[" + getarg(0) + "]"; mes "So how many times would you like me to refine your item?"; next; input .@refinecnt; set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part); if (.@refinecnt < 1 || .@refinecheck > 10) { mes "[" + getarg(0) + "]"; mes "I can't refine this item that many times."; close; } if(.@refinecheck > .@safe) { set .@refinecheck,.@refinecheck - .@safe; mes "[" + getarg(0) + "]"; mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?"; next; if(select("Yes...","No...") == 2){ mes "[" + getarg(0) + "]"; mes "You said so..Hmm so be it..."; close; } } break; case 3: next; mes "[" + getarg(0) + "]"; mes "You said so..Hmm so be it..."; close; } set .@fullprice,.@price * .@refinecnt; mes "[" + getarg(0) + "]"; mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?"; next; if(select("Yes","No...") == 2){ mes "[" + getarg(0) + "]"; mes "You said so..Hmm so be it..."; close; } if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) { mes "[" + getarg(0) + "]"; mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes."; close; } set Zeny,Zeny - .@fullprice; delitem .@material,.@refinecnt; while(.@refinecnt){ if (getequipisequiped(.@part) == 0) { mes "[" + getarg(0) + "]"; mes "Look here... you don't have any Items on..."; close; } if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) { mes "[" + getarg(0) + "]"; mes "Clan... No, but Did you imagine I could be so stupid !?!"; mes "You have changed it..."; mes "Go out before I stun you with my Hammer!!!"; close; } mes "Clang, clang!!!"; if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) { failedrefitem .@part; emotion 23; mes "[" + getarg(0) + "]"; mes "WAHHHH!!! I'm so sorry... I warned you this could happen..."; set .@refinecnt,.@refinecnt - 1; if(.@refinecnt == 0) close; mes "Here's the unused Zeny and Material back..."; getitem .@material,.@refinecnt; set .@fullprice,.@refinecnt * .@price; set Zeny,Zeny + .@fullprice; close; } successrefitem .@part; emotion 21; set .@refinecnt,.@refinecnt - 1; next; } mes "[" + getarg(0) + "]"; mes "All finished... Come again soon."; close; L_Repair: mes "Repairing it is!"; next; if (getbrokenid(1) == 0) goto L_Waste; mes "[" + getarg(0) + "]"; mes "Each repair costs 2000 zeny would you like to repair an item now?"; menu "Yes",L_RepairItem,"No",L_Bye; L_RepairItem: if(zeny < (2000)) goto L_NoZeny; mes "Select the item to repair from the menu."; set @choice, select(getitemname(getbrokenid(1)), getitemname(getbrokenid(2)), getitemname(getbrokenid(3)), getitemname(getbrokenid(4)), getitemname(getbrokenid(5)), getitemname(getbrokenid(6)), getitemname(getbrokenid(7)), getitemname(getbrokenid(8)), getitemname(getbrokenid(9)), getitemname(getbrokenid(10))); set zeny, zeny - 2000; repair(@choice); goto L_Repaired; L_Waste: mes "[" + getarg(0) + "]"; mes "Do not waste my time, you have no items in need of repair."; close; L_Repaired: mes "[" + getarg(0) + "]"; mes "Your item has been repaired, please be more careful."; close; } Didn't try it but the structure seems ok this way.
  25. Kurofly's post in unitattack issue was marked as the answer   
    I solved my problem
     
    If anyone ever wants to make monsters fight amongst themselves, here is what you need in order to do so:
     
     
    -open your server folder trunk/src/map/script.c and look for the monster function : 
    BUILDIN_FUNC(monster) { look for this line :
    int mobid = mob_once_spawn(sd, m, x, y, str, class_, 1, event, size, ai);  
    then replace it to these :
    int mobid = mob_once_spawn(sd, m, x, y, str, class_, 1, event, size, ai); script_pushint(st,mobid);  
    Now the monster command returns the GID of the monster created
     
    -make two monster, one with an IA of 0 and the other with an IA of 1, and save their GID to use it later :
    .gid1 = monster ("prontera",153,170,"poring",1002,1,"",0,0); .gid2 = monster ("prontera",154,170,"drops",1113,1,"",0,1); You can now use all of the GID based commands and make an epic fight between a poring and a drops 
     

×
×
  • Create New...