Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    246

Reputation Activity

  1. Upvote
    AnnieRuru got a reaction from Ehwaz in *setmobdata & *getmobdata   
    hmm ...
    I actually didn't know rathena already has it when I opened this topic
    I admit they at least tried to "make stuffs happens", although some of their design is flaw
     
    I think mine is a little bit better, because mine can modify attack damage for monster, which they can't
    but rathena also has a few stuffs that I didn't have, like the monster no cast skill flag, and I haven't code setmoblook
     
    erm .... HAHAHAHA !!
    so rathena monster's stat cannot change due to a bug
    https://github.com/rathena/rathena/issues/462
    https://github.com/rathena/rathena/issues/516
    https://github.com/rathena/rathena/issues/751
     
    it doesn't matter now, I copy all their good stuffs, so now mine is better than them
     
    patch 1.2
    http://upaste.me/ed6c2196382229bc7
    crazy 500 lines modification, hercules seriously missing many stuffs
  2. Upvote
    AnnieRuru got a reaction from mrlongshen in Cashmount   
    - script asdaskdha FAKE_NPC,{OnInit: setitemscript 12111 , "{ if ( !hascashmount() ) setcashmount; }", 1; setitemscript 12111 , "{ if ( hascashmount() ) setcashmount; }", 2; end;}
  3. Upvote
    AnnieRuru got a reaction from Kong in Emperium Breaker ladder   
    being asked too much in script request section, so better just release one
     
    script
    emp_breaker_ladder_1.0.txt
    patch ... no need recompile ...
    http://upaste.me/0b1d4993914f05487
     
    what this script do ?
    hmm ... just display the top players who has broke emperium ..
     
     
  4. Upvote
    AnnieRuru got a reaction from Easycore in PvP Ladder - Discount point at die   
    I'm quite sure SQL also can do it
     
    OnPCLoginEvent:
    query_sql "select charid from ladder order by kill limit "+ .ranksize, .@charid;
    for ( .@i = 0; .@i < .ranksize; .@i++ )
    if ( getcharid(0) == .@charid[.@i] )
    @pvprank = .@i +1;
    end;
     
    OnPCKillEvent:
    ....
    query_sql "select charid from ladder order by kill limit "+ .ranksize, .@charid;
    for ( .@i = 0; .@i < .ranksize; .@i++ )
    if ( getcharid(0) == .@charid[.@i] )
    .@tmprank = .@i +1;
    if ( .@tmprank > .@pvprank )
    announce strcharinfo(0) +" has gain to rank no."+ .@tmprank, bc_all;
     
     
    edit : paleface ... members are very good in digging out my old scripts ...
     
     
  5. Upvote
    AnnieRuru got a reaction from Kid BaKa in how to make list ID for mob ?   
    if you consider using SQL, then it is pretty neat
    prontera,155,189,5 script kshdfksjdf 1_F_MARIA,{ mes "input a mob ID"; mes "if your inputed mob ID is a non-aggresive mob, I'll say 'OK'"; next; input .@id, 1000, 5000; if ( query_sql( "select 1 from mob_db where mode & 0x4 = 0 and id = "+ .@id, .@dummy ) ) mes "OK"; else mes "bleh"; close;}otherwise if your list is custom made, then have to loop the arrayprontera,155,189,5 script kshdfksjdf 1_F_MARIA,{ mes "input a mob ID"; mes "if your inputed mob ID is a non-aggresive mob, I'll say 'OK'"; next; input .@id, 1000, 5000; while ( .mob_id[.@i] != .@id && .@i < .mob_size ) .@i++; if ( .@i < .mob_size ) mes "OK"; else mes "bleh"; close;OnInit: .mob_size = query_sql( "select ID from mob_db where mode & 0x4 = 0", .mob_id ); // change this to your setarray end;}but it seems you got your own ID, then have to loop it
  6. Upvote
    AnnieRuru got a reaction from Kid BaKa in how to make list ID for mob ?   
    while ( compare the value && loop until last index ) .@i++;if ( .@i < last index ) <is in the array>;actually that's my trickthere's a flaw in this method because if the value is not in the array,
    it will compare 1 extra time, and possibly throw error on certain script commands
    like *getmonsterinfo
     
    its better to do the actual way
    for ( .@i = 0; .@i < .max_value; ++.@i ) if ( .mob_id[.@i] == .@id ) break;if ( .@i < .max_value ) <is in the array>;never have problem with this one 
    well .. what you are asking ... better ask google XD
    https://www.codecademy.com/forum_questions/510e3c1a3011b8fa25005255
    ... try google more
     
    =================================
     
    btw that query has more than 400 results, so player might summon .... event mobs for example
  7. Upvote
    AnnieRuru got a reaction from evilpuncker in One char per gm account   
    nonono ... the char_make_new_char_sql function already has a slot variable
    so we can make use of that variable for not using sql syntax
     
    btw, my mistake for not using slot variable in my previous post, fixed
    src/char/char.c | 8 ++++++++ 1 file changed, 8 insertions(+)diff --git a/src/char/char.c b/src/char/char.cindex 41b13b3..d5849f5 100644--- a/src/char/char.c+++ b/src/char/char.c@@ -1671,6 +1671,9 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i return -2; // invalid input #endif + if ( slot != 0 && sd->group_id > 10 ) { // change 10 to minimum gm level+ return -2;+ } // check char slot if( sd->found_char[slot] != -1 ) return -2; /* character account limit exceeded */@@ -4574,6 +4577,11 @@ void char_parse_char_select(int fd, struct char_session_data* sd, uint32 ipl) } #endif + if ( slot != 0 && sd->group_id > 10 ) {+ chr->creation_failed(fd, -2);+ return;+ }+ ARR_FIND(0, ARRAYLENGTH(chr->server), server_id, chr->server[server_id].fd > 0 && VECTOR_LENGTH(chr->server[server_id].maps) > 0); /* not available, tell it to wait (client wont close; char select will respawn). * magic response found by Ind thanks to Yommy <3 */somehow I'm unable to write the char_parse_char_select as plugin ...I always get error for this line in plugin
    int slot = RFIFOB(fd,2);
  8. Upvote
    AnnieRuru got a reaction from iwarez in Script Truncate   
    - script resetter -1,{OnClock0025:mes "test"; // <--- what is this ?query_sql("TRUNCATE `dailyreward`"); end;}I'm sure you didn't check the map-server.exe for the errorthe error already print there
     
    it should say something like 'player not attached !'
     
    change that 'mes "test";' into 'announce "test", bc_all;' or 'debugmes "test";'
  9. Upvote
    AnnieRuru got a reaction from Skyline in Redeemer NPC / Coupon NPC / Promotional NPC   
    perfectly built script, I can only see 1 bug and 2 improvements
     
    1.
    bindatcmd "claim",strnpcinfo(3)+"::OnClaim"; bindatcmd "code",strnpcinfo(3)+"::OnEditCode";when you write an atcommand that player can usealways set charcommand level to 99 or 100
     
    its simple to reproduce
    when pvp/gvg, type '#claim <player name that you hated>' and will send a chat box on the player,
    cause him to have a moment of pause because need to type something
    yet again ... this kind of knowledge can only acquire when you have work on a live server =/
     
    2.
    so change into like this
    bindatcmd "claim",strnpcinfo(3)+"::OnClaim", 0, 100; bindatcmd "code",strnpcinfo(3)+"::OnEditCode", 99, 100;so you don't have to ( getgmlevel() < 99 ) end; 
    3.
    query_sql "SELECT `nameid`, `amount` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pc$) + "'", .@item, .@amt; if ( !.@item ) dispbottom "Either invalid code or the code is already claimed by other people";can be simplify as if ( !query_sql( "SELECT `nameid`, `amount` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pc$) + "'", .@item, .@amt ) ) dispbottom "Either invalid code or the code is already claimed by other people";
  10. Upvote
    AnnieRuru got a reaction from Legend in *setmobdata & *getmobdata   
    need to summon a hp 10,000,000 poring ?
    or you want to make emperium move ?
    yes, this plugin allows you to customize your monsters attribute
     
    Download : 1.2
    patch <-- rathena fellows, you are welcome to plagiarize this command, since your setunitdata can't change stats LOL
     
    I experienced in the past that, sometimes when my internet connection reset, my post will looks like rubbish
    this time I will make multiple posts to reduce the risk of my explanation so they wont get edited
     
     
     
  11. Upvote
    AnnieRuru got a reaction from MrSky in Bg_monster vs bg_monster   
    I already started writing battleground script since eathena you know ... ?
    https://www.eathena.ws/board/index.php?showtopic=276681
     
    and another
    https://rathena.org/board/topic/91274-about-mob-summoned-by-bg-monster/
     
    battleground monsters NEVER fight each other
    if you want, you have to make source modification ... probably in battle_check_target
     
     
    just to double check
    - script custom_bg#control FAKE_NPC,{OnStart: if ( !getwaitingroomstate( 0, "Attack Team" ) || !getwaitingroomstate( 0, "Defend Team" ) ) end; .atkteam = waitingroom2bg( "prontera", 152,187, "", "", "Attack Team" ); .defteam = waitingroom2bg( "prontera", 160,187, "", "", "Defend Team" ); delwaitingroom "Attack Team"; delwaitingroom "Defend Team"; bg_warp .atkteam, "prontera", 152,187; bg_warp .defteam, "prontera", 160,187; bg_monster .atkteam, "prontera", 155,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd"; bg_monster .defteam, "prontera", 157,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd"; sleep 10000; // 10 seconds to kill killmonster "prontera", "custom_bg#control::OnEnd"; bg_destroy .atkteam; bg_destroy .defteam; donpcevent "Attack Team::OnInit"; donpcevent "Defend Team::OnInit"; end;OnEnd:// awake strnpcinfo(0); end;}prontera,155,182,5 script Attack Team 1_F_MARIA,{ end;OnInit: waitingroom "ATTACK",2,"custom_bg#control::OnStart",1; end;}prontera,158,182,5 script Defend Team 1_F_MARIA,{ end;OnInit: waitingroom "DEFEND",2,"custom_bg#control::OnStart",1; end;}prontera mapflag battlegroundthis plugin should do it#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "map/mob.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = { "bgmobattack", // Plugin name SERVER_TYPE_MAP,// Which server types this plugin works with? "0.1", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated)};int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int flag ) { int16 m = target->m; struct block_list *s_bl = src, *t_bl = target; nullpo_ret(src); nullpo_ret(target); if( (t_bl = battle->get_master(target)) == NULL ) t_bl = target; if( (s_bl = battle->get_master(src)) == NULL ) s_bl = src; if ( t_bl->type == BL_MOB && s_bl->type == BL_MOB && map->list[m].flag.battleground ) if ( ((TBL_MOB*)t_bl)->bg_id != ((TBL_MOB*)s_bl)->bg_id ) return 1; return retVal;}HPExport void plugin_init (void) { addHookPost( "battle->check_target", battle_check_target_post );}
  12. Upvote
    AnnieRuru reacted to Emistry in edite my Healer by AnnieRuru   
    .@ori = countitem(Oridecon_Stone); if ( .@ori >= 5 ) { getitem Oridecon, .@ori / 5; delitem Oridecon_Stone, .@ori / 5 * 5; message strcharinfo(0), "Refined "+ ( .@ori / 5 * 5 ) +" Oridecon Stones, got "+ ( .@ori / 5 ) +" Oridecons."; } about this part ...
    i think should delete the items before give the user new items.
     
    if the player hold 99% of Elunium Stone and try to exchange into Elunium with the healer.
    the healer will probably give the Elunium, and the players overweight, items maybe not given / dropped on floor.
  13. Upvote
    AnnieRuru reacted to Jedzkie in Please Implement the Magic scroll, Mental Potion, etc. .   
    Hi @@kyeme,
     
    After 2 years, Hercules implement this (except for Spark_Candy)
     
    Commit: https://github.com/HerculesWS/Hercules/commit/f65e0326ac7e6faf17451d4c6d275e4fd3133cc0
     
    Regards,
  14. Upvote
    AnnieRuru got a reaction from mrlongshen in Find the MVP   
    https://eathena.ws/board/index.php?showtopic=243753
    it just exactly like find the mushroom event
     
    http://upaste.me/4b1521981271160f0
  15. Upvote
    AnnieRuru got a reaction from mrlongshen in 3rd Job Suit Problem   
    sry, I gave wrong answer
     
    I noticed we already have script commands to setoption, so there is no need to patch
    - script kfsdkfhsf FAKE_NPC,{OnInit: setitemscript 1201, "{ if ( Class == Job_Knight && checkmount() ) { setoption Option_Dragon1; } changebase roclass(eaclass()|EAJL_THIRD); }", 1; setitemscript 1201, "{ changebase Class; } ", 2; end;}
  16. Upvote
    AnnieRuru reacted to Samuel in Critical Display   
    why not just use latest revision? any problem on updating revision?
  17. Upvote
    AnnieRuru reacted to Dastgir in Undisguise when player die   
    if (sd == NULL)
    return 0;
     
    OR
     
    nullpo_retr(0,sd);
  18. Upvote
    AnnieRuru got a reaction from Danzon in Last Man Standing (using queue iterator script commands)   
    Haru has fixed the queue iterator script commands
    its time to spread out this technique
     
    Download: 1.2
    script
    Make sure your hercules server is compile after 2015-12-21
    errr ... maybe too strict xD
     
    good for server owner and scripter alike
    this can use in live server, and also can be a reference script for scripters
     
    Next, might want to bump the battleground queue again xD
     
     
     
  19. Upvote
    AnnieRuru got a reaction from MikZ in King Of Emperium Hill ROYAL Rumble   
    script and plugin
     
    ... erm ... I remember I said something about stop supporting on the board
    but I'm kinda ... having fun writing all these stuffs =/
  20. Upvote
    AnnieRuru got a reaction from MikZ in King Of Emperium Hill ROYAL Rumble   
    change
    #include "common/memmgr.h"into#include "common/malloc.h"..
    http://herc.ws/board/topic/8192-restock-system/?p=64596
    http://herc.ws/board/topic/4830-noitem-mapflag/?p=65839
     
     
    EDIT: oh and, since its your 1st time, always uncomment this line
  21. Upvote
    AnnieRuru got a reaction from MikZ in King Of Emperium Hill ROYAL Rumble   
    almost every hercules user know plugin
    http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC
     
    if you don't use this plugin, the one who owned this koe map can kill the emperium over and over
     
     
    EDIT:
    https://rathena.org/board/topic/103799-king-of-emperium-hill-royal-rumble/
    everyone there talk sh*t, doesn't make sense
  22. Upvote
    AnnieRuru got a reaction from Alexandria in Healer small edition   
    @@Winterfox
    that's opposite, I got negative value
     
    anyways, I prefer when set the permanent player variable, I set the time, without + or -
    //===== Description: =========================================//= Basic healer script.//===== Additional Comments: =================================//= 1.0 Initial script.//= 1.1 Aligned coordinates with @go.//= 1.2 Fix variables and character stuck at healing//============================================================- script Healer -1,{ if ( HEALCD + 60 > gettimetick(2) ) { dispbottom "You need wait for " + ( HEALCD + 60 - gettimetick(2) ) + " seconds."; end; } sc_end SC_STONE; sc_end SC_FREEZE; sc_end SC_STUN; sc_end SC_SLEEP; sc_end SC_POISON; sc_end SC_CURSE; sc_end SC_SILENCE; sc_end SC_CONFUSION; sc_end SC_BLIND; sc_end SC_BLEEDING; percentheal 100,100; specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; emotion e_lv; HEALCD = gettimetick(2); end;}// Duplicates//============================================================alberta,25,240,6 duplicate(Healer) Healer#alb 4_F_ACOLYTE,5,5prontera,155,185,5 duplicate(Healer) Healer#prt 1_F_MARIA,5,5and only do the + or - on the condition 
    because I learned it through my mvp ladder
    I did like winterfox on my mvp ladder (years ago) to deny entrance for 1 week
    then the owner (the server I work on) want to change into 5 hours
    then the player complain why those who had play before, can't go in immediately, still need to wait another 6 days ...
    so by then I only set a fixed time then
  23. Upvote
    AnnieRuru got a reaction from bWolfie in movespeed mapflag   
    this is useful for certain events when you want your players to move at a fixed speed
    eg: even if the player has agi up, mount peco or using Authoritative Badge,
    all players movement speed are fixed at your desire value
     
    Download: 1.3
    plugin
     
    Example:
    prontera mapflag movespeed 150 setmf_movespeed "prontera", 150; all players at prontera will move at default speed
    the value capped between 20~1000 
     
    prontera mapflag movespeed 150 99 setmf_movespeed "prontera", 150, 99; all players except GM99 at prontera will move at default speed
     
    removemf_movespeed "prontera"; remove the movespeed mapflag in prontera, without using "@reloadscript"
     
    dispbottom getmf_movespeed( "prontera" ) +""; dispbottom getmf_movespeed( "prontera", 0 ) +""; dispbottom getmf_movespeed( "prontera", 1 ) +""; first 2 lines return the movespeed value, 3rd line return the GM level bypass restriction
    Note: since the minimum value is 20, if the mapflag is off, return 0
     
     
  24. Upvote
    AnnieRuru got a reaction from Skyline in Script Command : setmobdata / getmobdata   
    oh someone link to me to this topic, I just found this
     
    I always thought modify a monster's attribute is a custom feature
    so I always thinking of writing it as plugin only
    but rathena have it 1st
     
    ok, upon closer inspection, I found that rathena way's of implementing them are less accurate
    com'on, once the monster is spawned, modify the monster's str will not increase its atk
    the same as increasing its agi will not make its flee higher
    adding those stats, like vit will only make the stun duration decrease, and int make freeze duration decrease only
    quite useless
     
    and Oh My God ? setunitdata can modify all different types of things
    but the way they write it, cannot use constants
    this is bullshit
    anyone who think this kind of modification is good enough to merge into hercules, please rethink again
    I'm going to write a better one
     
    *setmobdata/getmobdata
    I already have a plugin, going to make it into patch soon because rathena already have it, I'll pull request for hercules soon
     
    *setmoblook/getmoblook
    I think the md->state.xxxx should go different script command with md->vd.xxxxx
    so all md->vd.xxxxx will go into this script command
    currently rathena mix them all together, but I think they should be separated
     
    *mobevent <GID>, <type>, <event label>;
    this is missing from rathena I think
    this will make the current monster <GID> to run <event label> according to <type> happens
     
    currently I can think of
    MOBEVENT_ATTACK -> when monster attack an unit
    MOBEVENT_DAMAGE -> when monster hit by anything
    MOBEVENT_DETECT -> when monster sees an enemy
    MOBEVENT_KILL -> when monster killed a unit
    MOBEVENT_SKILL -> when monster cast a skill ( the skill cast adjusted in dbremob_skill_db.txt )
    MOBEVENT_RANDOMWALK -> when monster finished a random walk
    MOBEVENT_SUMMONSLAVE -> when monster summon slaves
    MOBEVENT_LOOT -> when monster loots an item
    MOBEVENT_EMOTION -> when monster doing an emotion
    MOBEVENT_TRANSFORM -> when monster transform into another monster (eg: pupa)
    ... maybe more
     
    example:
    mobevent .@id, MOBEVENT_DETECT, strnpcinfo(0)+"::OnDetect";when the monster detect an enemy, it will run that npc OnDetect: labelit will return $@mob_detect_id variable, GID of the unit
    .
     
    the rest, I think can follow rathena, but hercules version will have a complete list of constants
    I prefer to have a script full with constants, it will increase readability
     
    .
     
    I'm going to mark this one as rejected, and propose a better system like I stated
    and when I do it, I'll do little by little, system by system
    I also don't like aleos always put everything into 1 single patch and make big release
    this will make others harder to find the code
  25. Upvote
    AnnieRuru reacted to ossi0110 in noitem plugin   
    malloc.h got renamed into memmgr.h this is why the error appears
     
     
    he was using and old herc rev what dont got the changes
×
×
  • Create New...

Important Information

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