Jump to content

MikZ

Members
  • Content Count

    461
  • Joined

  • Last visited


Reputation Activity

  1. Upvote
    MikZ got a reaction from ThyroDree in Euphy's Quest Shop Help with Preview   
    Used this npc/custom/quests/quest_shop.txt
     
    //===== Hercules Script ====================================== //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6a //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.2 Added category support. //= 1.3 More options and fixes. //= 1.4 Added debug settings. //= 1.5 Replaced categories with shop IDs. //= 1.6 Added support for purchasing stackables. //= 1.6a Added support for previewing costumes and robes. //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; //============================================================ prontera,164,203,6 script Quest Shop#1 4_M_MOCASS2,{ callfunc "qshop"; } // Script Core //============================================================ - script quest_shop FAKE_NPC,{ function Add; function Chk; function Slot; function A_An; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0],"#CASHPOINTS","Cash Points"; // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1],"Headgears","Weapons","Other"; // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2); Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600); Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1); Add(1,5045,1,0,0,2252,1,1054,450,943,1200); Add(2,1224,1,0,0,7297,30,969,10,999,50,714,10); Add(2,1225,1,0,0,7292,30,969,10,999,50,714,10); Add(3,531,1,3,0,512,1,713,1); Add(3,532,1,3,0,513,1,713,1); Add(3,533,1,3,0,514,1,713,1); Add(3,534,1,3,0,515,1,713,1); // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) { set .menu$, .menu$+.Shops$[.@i]+":"; npcshopdelitem "qshop"+.@i,909; } end; OnMenu: set .@size, getarraysize(@i); if (!.@size) set .@i, select(.menu$); else if (.@size == 1) set .@i, @i[0]; else { for(set .@j,0; .@j<.@size; set .@j,.@j+1) set .@menu$, .@menu$+.Shops$[@i[.@j]]+":"; set .@i, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[.@i] == "") { message strcharinfo(PC_NAME),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshop"+.@i,1; npcshopattach "qshop"+.@i; end; OnBuyItem: // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray .@q[3],getd(".q_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+.@q[0])); set .@q[2],.@q[1]*.@q[3]; if (!.@q[2] || .@q[2] > 30000) { message strcharinfo(PC_NAME),"You can't purchase that many "+getitemname(.@q[0])+"."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000"; if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000"; if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000"; next; setarray @qe[1], getiteminfo(.@q[0], ITEMINFO_LOC), getiteminfo(.@q[0], ITEMINFO_VIEWSPRITE); if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT))) set .@preview,1; addtimer 1000, strnpcinfo(NPC_NAME)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+ getitemname(.@q[0]) +"^000000", ((.@preview && !@qe[7])?" ~ Preview...": ""), " ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[2])) { mes "[Quest Shop]"; mes "^FF0000You need "+(((.@q[2] * getiteminfo(.@q[0], ITEMINFO_WEIGHT)) + Weight - MaxWeight) / 10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[4]) Zeny -= (.@q[4]*.@q[1]); if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]); if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) delitem .@q[.@i],.@q[.@i+1]*.@q[1]; getitem .@q[0],.@q[2]; if (.Announce) announce strcharinfo(PC_NAME)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):A_An(getitemname(.@q[0])))+"!",0; specialeffect(EF_FLOWERLEAF, AREA, playerattached()); close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { consolemes(CONSOLEMES_WARNING, "Quest reward #"+getarg(1)+" invalid (skipped)."); return; } setarray .@j[0],getarg(2),getarg(3),getarg(4); for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) { if (getitemname(getarg(.@i)) == "null") { consolemes(CONSOLEMES_WARNING, "Quest requirement #"+getarg(.@i)+" invalid (skipped)."); return; } else setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1); } copyarray getd(".q_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set .@s$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return .@s$; case 2: if (getiteminfo(getarg(0), ITEMINFO_TYPE) == IT_WEAPON || getiteminfo(getarg(0), ITEMINFO_TYPE) == IT_ARMOR) return .@s$+" ["+getitemslots(getarg(0))+"]"; default: return .@s$; } } function A_An { setarray .@A$[0],"a","e","i","o","u"; set .@B$, "_"+getarg(0); for(set .@i,0; .@i<5; set .@i,.@i+1) if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0); return "a "+getarg(0); } } function script qshop { deletearray @i[0],getarraysize(@i); for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set @i[.@i],getarg(.@i); doevent "quest_shop::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 FAKE_NPC,909:-1 - shop qshop2 FAKE_NPC,909:-1 - shop qshop3 FAKE_NPC,909:-1 - shop qshop4 FAKE_NPC,909:-1 - shop qshop5 FAKE_NPC,909:-1  
  2. Upvote
    MikZ reacted to 4144 in error in skill.c 180   
    well gepard not prevent cheaters. it create some issues for botters only. Real protection can be only server side.
    from log this is packets with wrong skill id. you can ignore them or add some code for disconnect players with wrong skill sent.
     
    remove code what you add before, and place this code:
    if (skill->get_index(skill_id) == 0) { sockt->eof(fd); ShowWarning("Wrong skill detected %d. Player disconnected\n", skill_id); return; } This code should disconnect anyone who using skill what was not added to skill_db.
     
  3. Upvote
    MikZ reacted to meko in Remove Infinity Loop Error   
    freeloop(true); for (...) { ... } freeloop(false); basically you put the freeloop toggle around your for() loop
  4. Upvote
    MikZ reacted to meko in inarrary error (help)   
    inarray() is not a script command of Hercules (see the docs in doc/script_commands.txt) and is also not included in the "Array manipulation functions" script
     
    You should either replace it with a for() loop or if you want to use Array manipulation functions you should use array_exists() like so:
    // with Array manipulation functions: if (!array_exists(.@unique_id, get_unique_id())) { ... } // with a for() loop: .@size = getarraysize(.@unique_id); for (.@k = 0; .@k < .@size; ++.@k) { if (.@unique_id[.@k] == get_unique_id()) { break; } ... }  
    Keep in mind that get_unique_id() is also not part of Hercules so if you don't have a plugin that provides it or source mods (not recommended) it will not work
  5. Upvote
    MikZ reacted to 4144 in error in skill.c 180   
    you see ?? in my snipet? but error show what you add it
    this mean you add by self some chars. simply code only code what i gave
  6. Upvote
    MikZ reacted to Kenpachi in GEPARD SET AND GET   
    Hi.
     
    In src/map/script.c:
     
    Add this:
    BUILDIN(get_unique_id) { struct map_session_data* sd = script_rid2sd(st); if (sd == NULL) { script_pushint(st,0); return false; } script_pushint(st, sockt->session[sd->fd]->gepard_info.unique_id); return true; } Below:
    BUILDIN(resethate) { struct map_session_data *sd; if (script_hasdata(st, 2)) sd = script->id2sd(st, script_getnum(st, 2)); else sd = script->rid2sd(st); if (sd != NULL) pc->resethate(sd); return true; }  
    And add this:
    BUILDIN_DEF(get_unique_id, ""), Below:
    BUILDIN_DEF(openlapineddukddakboxui, "i"),  
    Don't forget to re-compile.
     
     
    ~Kenpachi
  7. Upvote
    MikZ reacted to 4144 in error in skill.c 180   
    look like same errors but other skill id
    client send wrong skills.
    if this is on your production server as i said before it can be some one who cheating.
    if on your local server, then some thing wrong with your client.
     
    also if you using any client modifications like game guard or external tools, this can be from this things too.
  8. Upvote
    MikZ reacted to Kuya Jeo in remove @go in PVP room (script command)   
    change this part of the code into this one
    function go { if (.deadlock && !Hp) { message strcharinfo(0), "You may not use @go when you are dead."; } else if (.town && !getmapflag(strcharinfo(3), mf_town)) { message strcharinfo(0), "You may only use @go in towns."; } else if (getmapflag(strcharinfo(3), mf_pvp)) { message strcharinfo(0), "You cannot use @go in PvP Maps."; } else if (.delay && @go_delay > gettimetick(2)) { message strcharinfo(0), "You must wait "+ (@go_delay - gettimetick(2)) +" seconds before warping again."; } else if (BaseLevel < getarg(3)) { message strcharinfo(0), "You must be at least level "+ getarg(3) +" to warp to this map."; } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorised to warp to this map."; } else if (.charge && Zeny < getarg(5)) { message strcharinfo(0), "You must have at least "+ getarg(5) +" zeny to warp to this map."; } else { if (.delay) { @go_delay = gettimetick(2) + .delay; } if (.charge) { Zeny -= getarg(5); } warp getarg(0), getarg(1), getarg(2); end; } message strcharinfo(0), "@go failed."; end; }  
    reload the script and try it
  9. Like
    MikZ got a reaction from Naruto in MVP Hunter Points w/ Rank   
    Hi @AnnieRuru, apologies.
    1. MVP list
    EASY
    Atroce   (ATROCE)   Mob-ID#1785
    Bacsojin / White Lady   (BACSOJIN_)   Mob-ID#1630
    Boitata   (BOITATA)   Mob-ID#2068
    Doppelganger   (DOPPELGANGER)   Mob-ID#1046
    Dracula   (DRACULA)   Mob-ID#1389
    Drake   (DRAKE)   Mob-ID#1112
    Eddga   (EDDGA)   Mob-ID#1115
    Garm / Hatii   (GARM)   Mob-ID#1252
    Gopinich   (GOPINICH)   Mob-ID#1885
    Maya   (MAYA)   Mob-ID#1147
    Mistress   (MISTRESS)   Mob-ID#1059
    Osiris   (OSIRIS)   Mob-ID#1038
    Pharaoh   (PHARAOH)   Mob-ID#1157
    Phreeoni   (PHREEONI)   Mob-ID#1159
    Tao Gunka   (TAO_GUNKA)   Mob-ID#1583
    Turtle General   (TURTLE_GENERAL)   Mob-ID#1312
    Vesper   (APOCALIPS_H)   Mob-ID#1685
    NORMAL
    Amon Ra   (AMON_RA)   Mob-ID#1511
    Baphomet   (BAPHOMET)   Mob-ID#1039
    Dark Lord   (DARK_LORD)   Mob-ID#1272
    Detale / Detardeurus   (DETALE)   Mob-ID#1719
    Evil Snake Lord   (DARK_SNAKE_LORD)   Mob-ID#1418
    Golden Thief Bug   (GOLDEN_BUG)   Mob-ID#1086
    Incantation Samurai / Samurai Specter   (INCANTATION_SAMURAI)   Mob-ID#1492
    Knight of Windstorm / Stormy Knight   (KNIGHT_OF_WINDSTORM)   Mob-ID#1251
    Lady Tanee   (LADY_TANEE)   Mob-ID#1688
    Lord of Death / Lord of the Dead   (LORD_OF_DEATH)   Mob-ID#1373
    Moonlight Flower   (MOONLIGHT)   Mob-ID#1150
    Orc Hero   (ORK_HERO)   Mob-ID#1087
    Orc Lord   (ORC_LORD)   Mob-ID#1190
    RSX 0806 / RSX-0806   (RSX_0806)   Mob-ID#1623
    Wounded Morroc   (MOROCC_)   Mob-ID#1917
    HARD
    Beelzebub   (BEELZEBUB_)   Mob-ID#1874
    Fallen Bishop / Fallen Bishop Hibram   (FALLINGBISHOP)   Mob-ID#1871
    Gloom Under Night   (GLOOMUNDERNIGHT)   Mob-ID#1768
    Ifrit   (IFRIT)   Mob-ID#1832
    Kiel D-01   (KIEL_)   Mob-ID#1734
    Ktullanux   (KTULLANUX)   Mob-ID#1779
    Thanatos / Memory of Thanatos   (THANATOS)   Mob-ID#1708
    Valkyrie Randgris   (RANDGRIS)   Mob-ID#1751
    2. Will wait for it /no1 <--- Can we skip the rank Name and just the killing points only for meantime. if possible
    3. For monthly only
    4. Points trigger on MVP maps only. (branch and bloody branch summons not included)
     
    Thank you so much!
  10. Like
    MikZ reacted to AnnieRuru in MVP Hunter Points w/ Rank   
    wait wait, I was asking question back before attempting to write out this script,
    and I still haven't made title system script commands plugin yet ...
    I don't understand why you mark that as answer while I was actually asking for more information ...
     
    rephrase again
    1. you have to list out which MVP are easy/normal/hard,
    easy - MVPID 1 , MVPID 2 ...
    normal - MVPID 1 , MVPID 2 ...
    ...
    2. wait until I make title system script commands plugin .... going to write now
    3. rewards give out by weekly or monthly are entire different formula ... you can only pick one ...
    4. MVP points will trigger on MVP maps only  <-- means only trigger like .... inside MVP room only ?
  11. Like
    MikZ reacted to Dastgir in npc_event: player's event queue is full   
    src/map/mapdefines.h
  12. Upvote
    MikZ reacted to AnnieRuru in MVP Hunter Points w/ Rank   
    I do have my own MVP ranking script
    https://github.com/AnnieRuru/Release/tree/master/scripts/Games %26 Events/MVP Rank
     
     
    usually people do this simply with
    if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) { but since you have 3 different modes, you also have to list out which MVP is easy/moderate/hard
    a quick sql query to list out MVP in your server
    select * from mob_db where mexp > 0; note its different in renewal and pre-renewal
    Renewal -> http://herc.ws/board/topic/16631-npc-mvp-invasion/?do=findComment&comment=90910
    Pre-renewal -> https://github.com/rathena/rathena/blob/master/npc/custom/events/mvp_ladder.txt#L232-L270
     
     
    this one needs achievement system ... its already in my top-priority todo list
    once its out, I can also add *settitleid script command and so on ...
     
     
    and before you forget, the OnNPCKillEvent cannot run on monsters with event labels
    http://herc.ws/board/topic/15991-onnpckillevent-changes/
    so it couldn't add the kills like bio-lab MVPs , instance MVPs and so on
    that pull request got stuck ...
     
    oh PS: pajodex is currently busy in real life, or so I heard
  13. Upvote
    MikZ reacted to AnnieRuru in fixedaspd mapflag   
    1.2 - plugin
    - update to latest revision
    - add GM level bypass restriction
    - add *setmapflagfixedaspd *removemapflagfixedaspd *getmapflagfixedaspd script command
  14. Upvote
    MikZ reacted to AnnieRuru in movespeed mapflag   
    1.2 - plugin
    - update to latest revision
    - add GM level bypass restriction
    - add *setmapflagmovespeed *removemapflagmovespeed *getmapflagmovespeed script command
  15. Upvote
    MikZ reacted to AnnieRuru in Daily random supplies   
    https://rathena.org/board/topic/114244-andro-for-athena/
    the latest AndRO is 20171227, and the new quest log is only for 2018-03-07b onward
    use old school method then
    https://github.com/AnnieRuru/Release/blob/master/scripts/Utility/daily supply/daily_supply_0.3.txt
     
    20180621 is the default version rathena is using right now, so I guess its stable
  16. Upvote
    MikZ reacted to AnnieRuru in Sample Questlog & Achievement script   
    the new quest log window is only for 2018-03-07b onward, so if your client is not so up to date, can use version 0.3 ...
    nope, that is just some information when I brainstorming some quest idea
    about Dastgir's idea that add custom quest in Any tab, I'm thinking not going for it,
    because I'm thinking of integrate this with achievement system ...
    using such old client version also means you can't use more modern features
  17. Upvote
    MikZ reacted to AnnieRuru in @die delay on hit   
    almost similar to this
     
    #include "common/hercules.h" #include "map/pc.h" #include "map/atcommand.h" #include "common/timer.h" #include "common/memmgr.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "die_delay", SERVER_TYPE_MAP, "x_O", HPM_VERSION, }; ACMD(kill) { if ( DIFF_TICK( timer->gettick(), sd->canlog_tick ) < battle->bc->prevent_logout ) { char msg[CHAT_SIZE_MAX]; safesnprintf( msg, CHAT_SIZE_MAX, "There is a %d seconds delay of using this command to kill the character again", battle->bc->prevent_logout /1000 ); clif->message( fd, msg ); return false; } status_kill( &sd->bl ); clif->message( sd->fd, msg_fd( fd, 13 )); // A pity! You've died. if ( fd != sd->fd ) clif->message( fd, msg_fd( fd, 14 )); // Character killed. return true; } HPExport void plugin_init (void) { addAtcommand( "kill", kill ); } this assume your prevent_logout in your battle_config has default setting
    // Prevent logout of players after being hit for how long (in ms, 0 disables)? prevent_logout: 10000 // When should the server prevent a player from logging out? Have no effect if prevent_logout is disabled. (Note 3) // Official servers prevent players from logging out after attacking, casting skills, and taking damage. // 0 = Players can always logout // 1 = Prevent logout on login // 2 = Prevent logout after attacking // 4 = Prevent logout after casting skill // 8 = Prevent logout after being hit prevent_logout_trigger: 14 prevent_logout_trigger have to at least has 2+8
  18. Upvote
    MikZ reacted to AnnieRuru in Daily random supplies   
    erm ... its getting interestingly ... complexity ...
  19. Upvote
    MikZ reacted to Kuroe in Daily random supplies   
    Like this?
    prontera,158,167,3 script Sample 4_M_SIT_NOVICE,{ if (#gotreward + .next_take> gettimetick(2)) { mes "[Random Item Giver]"; mes "Please talk to me after 24 hours."; close; } else { set .random1,rand(getarraysize (.count1)); set .random2,rand(getarraysize (.count2)); set .random3,rand(getarraysize (.count3)); mes "[Random Item Giver]"; mes "Have some of these!"; getitem .item[rand(getarraysize (.item))],.count1[.random1]; getitem .item[rand(getarraysize (.item))],.count2[.random2]; getitem .item[rand(getarraysize (.item))],.count3[.random3]; #gotreward = gettimetick(2); next; close; } OnInit: .next_take = 24*60*60; setarray .item[0],656,657,505,645,506,14510; setarray .count1[0],1,10; setarray .count2[0],5,15; setarray .count3[0],10,20; end; } Edit: 
    Thought it was 1-10 , 5-15 , and 10-20 instead of 1,10 5,15 and 10,20
  20. Upvote
    MikZ reacted to utofaery in Daily random supplies   
    prontera,158,167,3 script Sample 4_M_SIT_NOVICE,{ if (#xTaken + .next_take> gettimetick(2)) { mes "[Random Item Giver]"; mes "Please talk to me after 24 hours."; close; } else { mes "[Random Item Giver]"; mes "Have some of these!"; .@riRate1 = rand (.@Ai11,.@Ai12); .@riRate2 = rand (.@Ai21,.@Ai22); .@riRate3 = rand (.@Ai31,.@Ai32); .@rItemid1 = .@Aitem1[rand(getarraysize (.@Aitem1))]; .@rItemid2 = .@Aitem2[rand(getarraysize (.@Aitem2))]; .@rItemid3 = .@Aitem3[rand(getarraysize (.@Aitem3))]; getitem ( .@rItemid1, .@riRate1 ) ; // dispbottom ( "rItemid1 :: " + .@rItemid1 + " riRate1 :: " + .@riRate1 + " Name :: " + getitemname ( .@rItemid1 ) ) ; // debug use only !!! getitem ( .@rItemid2, .@riRate2 ) ; // dispbottom ( "rItemid2 :: " + .@rItemid2 + " riRate2 :: " + .@riRate2 + " Name :: " + getitemname ( .@rItemid2 ) ) ; // debug use only !!! getitem ( .@rItemid3, .@riRate3 ) ; // dispbottom ( "rItemid3 :: " + .@rItemid3 + " riRate3 :: " + .@riRate3 + " Name :: " + getitemname ( .@rItemid3 ) ) ; // debug use only !!! #xTaken = gettimetick(2); next; close; } OnInit: //set cooldown to take item again. .next_take = 24*60*60; //set item here setarray .Aitem1[0],501,502,503,504,505,14510; setarray .Aitem2[0],601,602,603,604,605,14510; setarray .Aitem3[0],701,702,703,704,705,14510; //set rate here .Ai11 = 1; .Ai12 = 10; .Ai21 = 5; .Ai22 = 15; .Ai31 = 10; .Ai32 = 20; end; } Refined and fixed up npc variable..
  21. Upvote
    MikZ reacted to AnnieRuru in Daily random supplies   
    https://github.com/AnnieRuru/Release/blob/master/Guides/Daily Quest - use gettimetick(2) or gettimestr.md
    function script timeleft__ { .@left = getarg(0); if ( .@left <= 0 ) return getarg(0); .@day = .@left / 86400; .@hour = .@left % 86400 / 3600; .@min = .@left % 3600 / 60; .@sec = .@left % 60; if ( .@day ) return sprintf( _$( "%d day %d hour" ), .@day, .@hour ); else if ( .@hour ) return sprintf( _$( "%d hour %d min" ), .@hour, .@min ); else if ( .@min ) return sprintf( _$( "%d min %d sec" ), .@min, .@sec ); else return sprintf( _$( "%d sec" ), .@sec ); } prontera,155,185,5 script kjdsfhskhf 1_F_MARIA,{ .@today = atoi( gettimestr( "%Y%m%d", 9 ) ); if ( #daily_supply == .@today ) { mes "You have already taken today's supply"; mesf "You have to wait %s countdown to get next supply", timeleft__( getcalendartime(0,0) - gettimetick(2) ); close; } getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(1,10); getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(5,15); getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(10,20); #daily_supply = .@today; end; }
  22. Upvote
    MikZ reacted to AnnieRuru in Daily random supplies   
    curious, why all 3 sets have same item ID ?
    so it means they can be repeated ?
     
    prontera,155,185,5 script kjdsfhskhf 1_F_MARIA,{ getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(1,10); getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(5,15); getitem F_Rand( 656, 657, 505, 645, 506, 14510 ), rand(10,20); end; }  
  23. Upvote
    MikZ reacted to Dastgir in Unhandled Packet   
    Which client you are using? When does this happen(login in/using skills/char select/etc)
  24. Upvote
    MikZ reacted to 4144 in Unhandled Packet   
    This should be fixed already
  25. Upvote
    MikZ reacted to AnnieRuru in Sample Questlog & Achievement script   
    Mass update to version 1
    compatible with Hercules 2019-02-24 and client 2018-06-20Re

    https://github.com/AnnieRuru/Release/blob/master/scripts/Quest %26 Shops/quest log/quest_log_1.0.txt
    @MikZ, the thing you describe there is official
    https://github.com/HerculesWS/Hercules/pull/1593#issuecomment-284083798
    so just in case you don't understand, I make another sample then
    https://github.com/AnnieRuru/Release/blob/master/scripts/Quest %26 Shops/quest log/daily_quest_log_1.0.txt
×
×
  • Create New...

Important Information

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