Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    245

Reputation Activity

  1. Upvote
    AnnieRuru got a reaction from anacondaq in Sample Questlog & Achievement script   
    Download: 1.1
    sample quest log
    Download: 1.1
    sample daily quest
    these are 5 sample quests using quest log system
    this was actually made as a sample script inside a script support section in eathena forum
    original topic from eathena
    thanks to paradog eathena admin that makes eathena forum down, almost gonna remake everything from scratch
    luckily I got a few segment here and there in my old hard-disk so doesn't take too much time to write this sample
    Quest #1
    typical talk to npc A, then npc B ... etc
    demonstrate how to use *checkquest
    Quest #2
    collect item quest
    just checkitem with it
    I still don't know how to use the client to trace is the item collecting has completed or not
    Quest #3
    kill monster quest
    demonstrate how to use *checkquest( x, HUNTING )
    Quest #4
    typical talk to npc A, then npc B ... BUT with a time limit
    demonstrate how to use *checkquest( x, PLAYTIME )
    Quest#5
    if player having this quest, player can *getitem by killing this monster
    see https://github.com/HerculesWS/Hercules/blob/stable/db/quest_db.conf#L45-L50

     

    and I want to remind this is just a sample script
    usually make for source modification on quest log system (now is 3rd time I think ?)
     
     
     
    2 sample script for daily system
    1. Daily item giver ...
    although I think this should done with attendance system ...
    2. Daily hunting ...
    self explain ...


     
     
    [109991] = { UI_Type = 0, group = "CHATTING", major = 4, minor = 0, title = "Tavern Helper", content = { summary = "Visit the Tavern Master", details = "Visit the Tavern Master in Prontera." }, resource = { [1] = { text = "Acolyte Trouble" }, [2] = { text = "Gemstone shortage" }, [3] = { text = "Poring Problem" }, [4] = { text = "Hand over the Artifact" }, [5] = { text = "Shining Rocker" } }, reward = { title = 991 }, score = 5 }, [109992] = { UI_Type = 1, group = "GOAL_ACHIEVE", major = 6, minor = 0, title = "Complete Daily Quest for 30 times", content = { summary = "Complete Daily Quest", details = "Complete Daily Quest for 30 times and you can earn some nice rewards!" }, resource = { [1] = { text = "Collect Daily Items 30 times", count = 30 }, [2] = { text = "Complete Daily Quest 30 times", count = 30 } }, reward = { title = 992, item = 513 }, score = 30 }, UI_TYPE
    - display a bar like in the daily quest screenshot
    - 0: in the [resource], doesn't support [count]
    - 1: support [count]
    group:
    - read from data\texture\À¯ÀúÀÎÅÍÆäÀ̽º\achievement

    major
    - 1: General tab
    - 2: Adventure tab
    - 3: Battle tab
    - 4: Quest tab
    - 5: Memorial tab
    - 6: Feat tab
  2. Upvote
    AnnieRuru got a reaction from Zirius in @fontcolor showing unnecessary logging effect?   
    20140115
     
    maybe should move to client support ?
  3. Upvote
    AnnieRuru got a reaction from xathenx in Guild Package   
    no need src, just query_sql will do
     
    however there is no getguildlv script command, only getgdskilllv script command though
    very easy to code though
    prontera,147,175,6 script kjdhfksdjf 100,{ .@req_online = 11; // how many players need to online to claim. Default: 11 .@req_lv = MAX_LEVEL; // minimum level of .@online players that has to be. Default: MAX_LEVEL in mmo.h if ( !getcharid(2) ) { mes "you must have a guild"; close; } if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) { mes "you are not a guild master"; close; } getguildmember getcharid(2), 1; getguildmember getcharid(2), 2; for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) .@online++; if ( .@online < .@req_online ) { mes "your guild must have "+ .@req_online +" guild members online"; close; } .@origin = getcharid(3); for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) { if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) { attachrid $@guildmemberaid[.@i]; if ( BaseLevel < .@req_lv ) { .@deny_name$[.@c] = strcharinfo(0); .@c++; } } } attachrid .@origin; if ( .@c ) { mes "there are "+ .@c +" member does not meet the level requirement"; mes implode( .@deny_name$, "," ); close; } for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) { if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) { attachrid $@guildmemberaid[.@i]; if ( #guild_package_claimed ) { .@deny_name$[.@c] = strcharinfo(0); .@c++; } } } attachrid .@origin; if ( .@c ) { mes "there are "+ .@c +" members already claimed this package within their account"; mes implode( .@deny_name$, "," ); close; } if ( query_sql( "select account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2) +" group by last_ip", .@aid, .@ip$ ) < .@req_online ) { mes "same ip detected"; .@nb = query_sql( "select name, account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2), .@name$, .@aid, .@ip$ ); for ( .@i = 0; .@i < .@nb; .@i++ ) mes (.@i +1)+". "+ .@name$[.@i] +" ("+ .@ip$ +")"; next; } mes "pass"; for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) { if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) { attachrid $@guildmemberaid[.@i]; if ( getguildmasterid( getcharid(2) ) != $@guildmembercid[.@i] ) getitem 501, 1; else getitem 501, 10; #guild_package_claimed = 1; } } attachrid .@origin; close;}
  4. Upvote
    AnnieRuru got a reaction from Edgar in loadmapevent help.   
    I noticed at the beginning of the script, there are *mes script commands
    so I guess you didn't post the duplicate npc part
     
    of course it will spam the dialog because you duplicated the OnPCLoadMapEvent labels multiple times
     
    change this
    - script Buff -1,{ mes "hi"; close;OnPCLoadMapEvent: buffing.... end;}prontera,x,y,z duplicate(Buff) Buff#1 100izlude,x,y,z duplicate(Buff) Buff#2 100geffen,x,y,z duplicate(Buff) Buff#3 100into this- script Buff -1,{ mes "hi"; close;}- script Buff#main -1,{OnPCLoadMapEvent: buffing.... end;}prontera,x,y,z duplicate(Buff) Buff#1 100izlude,x,y,z duplicate(Buff) Buff#2 100geffen,x,y,z duplicate(Buff) Buff#3 100so the OnPCLoadMapEvent doesn't get duplicated
  5. Upvote
    AnnieRuru got a reaction from vBrenth in loadmapevent help.   
    this should work
    - script Anti_Assump -1,{OnInit: setarray .@map$[0],"prtg_cas03","gefg_cas04","payg_cas03","schg_cas01","guild_vs1"; .@size = getarraysize( .@map$ ); for ( .@i = 0; .@i < .@size; .@i++ ) { setd ".map_"+ .@map$[.@i], true; setmapflag .@map$[.@i], mf_loadevent; } end;OnPCLoadMapEvent: if ( getd( ".map_"+ strcharinfo(3) ) && getstatus(SC_ASSUMPTIO) ) { sc_end SC_ASSUMPTIO; message strcharinfo(0), "Assumptio buff are disable in GvG/WoE maps."; } end;}
  6. Upvote
    AnnieRuru got a reaction from GmOcean in plugin missing hook to struct item_data* and mob_data*   
    /* HPData handy redirects *//* session[] */#define addToSession(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_SESSION,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromSession(ptr,index) (HPMi->getFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))#define removeFromSession(ptr,index) (HPMi->removeFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))/* map_session_data */#define addToMSD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MSD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMSD(ptr,index) (HPMi->getFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))#define removeFromMSD(ptr,index) (HPMi->removeFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))/* npc_data */#define addToNPCD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_NPCD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromNPCD(ptr,index) (HPMi->getFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))#define removeFromNPCD(ptr,index) (HPMi->removeFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))/* map_data */#define addToMAPD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MAP,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMAPD(ptr,index) (HPMi->getFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))#define removeFromMAPD(ptr,index) (HPMi->removeFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))/* party_data */#define addToPAD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_PARTY,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromPAD(ptr,index) (HPMi->getFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))#define removeFromPAD(ptr,index) (HPMi->removeFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))/* guild */#define addToGLD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_GUILD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromGLD(ptr,index) (HPMi->getFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))#define removeFromGLD(ptr,index) (HPMi->removeFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))/* instance_data */#define addToINSTD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromINSTD(ptr,index) (HPMi->getFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))#define removeFromINSTD(ptr,index) (HPMi->removeFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))where is item_data and mob_data ? 
    if allow to item_data, we can do something like this Cydh did
    allows item data to have optional field, which can do the following
    - restrict GM from create the item
    - restrict GM from refine the item
    ... some other idea
     
    if allow to mob_data, allow monster to do the following like mob_controller
    - restrict player from hitting the mob ( mob->invincible )
    - create a monster that no random walk ( it stand still until being attack )
    ... some other idea
  7. Upvote
    AnnieRuru got a reaction from Angelmelody in how to declare a new PLAYER source variable in a plugin file   
    got it
    http://upaste.me/3700f1
     
    I got help from this topic too
    http://rathena.org/board/topic/89230-can-any-one-convert-this-for-use-with-rathena-version-17690-or-diff-please/
     
     

    . .
    .
    but why only these few ?
     
    /* HPData handy redirects *//* session[] */#define addToSession(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_SESSION,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromSession(ptr,index) (HPMi->getFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))#define removeFromSession(ptr,index) (HPMi->removeFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))/* map_session_data */#define addToMSD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MSD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMSD(ptr,index) (HPMi->getFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))#define removeFromMSD(ptr,index) (HPMi->removeFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))/* npc_data */#define addToNPCD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_NPCD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromNPCD(ptr,index) (HPMi->getFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))#define removeFromNPCD(ptr,index) (HPMi->removeFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))/* map_data */#define addToMAPD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MAP,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMAPD(ptr,index) (HPMi->getFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))#define removeFromMAPD(ptr,index) (HPMi->removeFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))/* party_data */#define addToPAD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_PARTY,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromPAD(ptr,index) (HPMi->getFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))#define removeFromPAD(ptr,index) (HPMi->removeFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))/* guild */#define addToGLD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_GUILD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromGLD(ptr,index) (HPMi->getFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))#define removeFromGLD(ptr,index) (HPMi->removeFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))/* instance_data */#define addToINSTD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromINSTD(ptr,index) (HPMi->getFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))#define removeFromINSTD(ptr,index) (HPMi->removeFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))where is item_data and mob_data ?gonna suggest them
  8. Upvote
    AnnieRuru got a reaction from Yoh Asakura in Help to update this npc   
    LOL you mixed up both
     
    sql query, this one added the index
    alter table `char` add empbreak smallint(6) unsigned not null default 0 after unban_time, add index (empbreak);..
    npc/guild/agit_main.txt
    query_sql "UPDATE `char` SET empbreak = empbreak+1 WHERE char_id = " + getcharid(0);which is already correct.
    .
    ////============================//// Emp Breaking Ladder////============================prontera,155,183,4 script Emperium Ranking 722,{ .@nb = query_sql( "select name, empbreak from `char` where empbreak > 0 order by empbreak desc limit 10", .@name$, .@empbreak ); mes "^FF0000[ Emperium Ranking ]^000000"; for ( .@i = 0; .@i < .@nb; .@i++ ) mes "^0000FF"+ ( .@i +1 ) +".^000000 " + .@name$[.@i] +" - ^FF0000"+ .@empbreak[.@i] +"^000000 Break(s)"; mes " "; query_sql "select empbreak from `char` where char_id = "+ getcharid(0), .@empbreak; mes "^0000FF["+ strcharinfo(0) +"'s]^000000 Emperium Break's is ^FF0000" + .@empbreak + "^000000 Break(s)"; close;OnInit:// waitingroom "Emperium's Ranking",0; // Look on the configuration! end;}use this script
  9. Upvote
    AnnieRuru got a reaction from Yugosh in change to item reward hunting mission   
    #Mission_Points
    search for it and delete every single line
    and also remove the npc shop below
  10. Upvote
    AnnieRuru reacted to Dastgir in @market command   
    @Cydh, Please avoid quoting many quotes..
     
    Me Puts a Teaser :
    (still On Work)
     
  11. Upvote
    AnnieRuru got a reaction from Garr in Update *recovery script command   
    http://rathena.org/board/topic/82374-recovery-script-command/
    I keep drooling for this command to be added, so Ima write one myself
     
    no more atcommand @raise, @raisemap or @alive anymore !
     
    pull request->
    https://github.com/HerculesWS/Hercules/pull/350
  12. Upvote
    AnnieRuru got a reaction from evilpuncker in Update *recovery script command   
    http://rathena.org/board/topic/82374-recovery-script-command/
    I keep drooling for this command to be added, so Ima write one myself
     
    no more atcommand @raise, @raisemap or @alive anymore !
     
    pull request->
    https://github.com/HerculesWS/Hercules/pull/350
  13. Upvote
    AnnieRuru got a reaction from Dastgir in plugin missing hook to struct item_data* and mob_data*   
    /* HPData handy redirects *//* session[] */#define addToSession(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_SESSION,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromSession(ptr,index) (HPMi->getFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))#define removeFromSession(ptr,index) (HPMi->removeFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))/* map_session_data */#define addToMSD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MSD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMSD(ptr,index) (HPMi->getFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))#define removeFromMSD(ptr,index) (HPMi->removeFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))/* npc_data */#define addToNPCD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_NPCD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromNPCD(ptr,index) (HPMi->getFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))#define removeFromNPCD(ptr,index) (HPMi->removeFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))/* map_data */#define addToMAPD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MAP,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMAPD(ptr,index) (HPMi->getFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))#define removeFromMAPD(ptr,index) (HPMi->removeFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))/* party_data */#define addToPAD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_PARTY,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromPAD(ptr,index) (HPMi->getFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))#define removeFromPAD(ptr,index) (HPMi->removeFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))/* guild */#define addToGLD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_GUILD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromGLD(ptr,index) (HPMi->getFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))#define removeFromGLD(ptr,index) (HPMi->removeFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))/* instance_data */#define addToINSTD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromINSTD(ptr,index) (HPMi->getFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))#define removeFromINSTD(ptr,index) (HPMi->removeFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))where is item_data and mob_data ? 
    if allow to item_data, we can do something like this Cydh did
    allows item data to have optional field, which can do the following
    - restrict GM from create the item
    - restrict GM from refine the item
    ... some other idea
     
    if allow to mob_data, allow monster to do the following like mob_controller
    - restrict player from hitting the mob ( mob->invincible )
    - create a monster that no random walk ( it stand still until being attack )
    ... some other idea
  14. Upvote
    AnnieRuru got a reaction from evilpuncker in plugin missing hook to struct item_data* and mob_data*   
    /* HPData handy redirects *//* session[] */#define addToSession(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_SESSION,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromSession(ptr,index) (HPMi->getFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))#define removeFromSession(ptr,index) (HPMi->removeFromHPData(HPDT_SESSION,HPMi->pid,(ptr),(index)))/* map_session_data */#define addToMSD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MSD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMSD(ptr,index) (HPMi->getFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))#define removeFromMSD(ptr,index) (HPMi->removeFromHPData(HPDT_MSD,HPMi->pid,(ptr),(index)))/* npc_data */#define addToNPCD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_NPCD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromNPCD(ptr,index) (HPMi->getFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))#define removeFromNPCD(ptr,index) (HPMi->removeFromHPData(HPDT_NPCD,HPMi->pid,(ptr),(index)))/* map_data */#define addToMAPD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MAP,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromMAPD(ptr,index) (HPMi->getFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))#define removeFromMAPD(ptr,index) (HPMi->removeFromHPData(HPDT_MAP,HPMi->pid,(ptr),(index)))/* party_data */#define addToPAD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_PARTY,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromPAD(ptr,index) (HPMi->getFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))#define removeFromPAD(ptr,index) (HPMi->removeFromHPData(HPDT_PARTY,HPMi->pid,(ptr),(index)))/* guild */#define addToGLD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_GUILD,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromGLD(ptr,index) (HPMi->getFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))#define removeFromGLD(ptr,index) (HPMi->removeFromHPData(HPDT_GUILD,HPMi->pid,(ptr),(index)))/* instance_data */#define addToINSTD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(data),(index),(autofree)))#define getFromINSTD(ptr,index) (HPMi->getFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))#define removeFromINSTD(ptr,index) (HPMi->removeFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))where is item_data and mob_data ? 
    if allow to item_data, we can do something like this Cydh did
    allows item data to have optional field, which can do the following
    - restrict GM from create the item
    - restrict GM from refine the item
    ... some other idea
     
    if allow to mob_data, allow monster to do the following like mob_controller
    - restrict player from hitting the mob ( mob->invincible )
    - create a monster that no random walk ( it stand still until being attack )
    ... some other idea
  15. Upvote
    AnnieRuru reacted to Dastgir in how to declare a new PLAYER source variable in a plugin file   
    sample.c
    struct sample_data_struct { struct point lastMSGPosition; unsigned int someNumber;};void sample_packet0f3(int fd) { struct map_session_data *sd = session[fd]->session_data; struct sample_data_struct *data; if( !sd ) return;/* socket didn't fully log-in? this packet shouldn't do anything then! */ ShowInfo("sample_packet0f3: Hello World! received 0xf3 for '%s', redirecting!n",sd->status.name); /* sample usage of appending data to a map_session_data (sd) entry */ if( !(data = getFromMSD(sd,0)) ) { CREATE(data,struct sample_data_struct,1); data->lastMSGPosition.map = sd->status.last_point.map; data->lastMSGPosition.x = sd->status.last_point.x; data->lastMSGPosition.y = sd->status.last_point.y; data->someNumber = rand()%777; ShowInfo("Created Appended map_session_data data, %d %d %d %dn",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber); addToMSD(sd,data,0,true); } else { ShowInfo("Existent Appended map_session_data data, %d %d %d %dn",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber); if( rand()%4 == 2 ) { ShowInfo("Removing Appended map_session_data datan"); removeFromMSD(sd,0); } } clif->pGlobalMessage(fd,sd);} I use that getfromMSD Method, and saves the data into sql at regular intervals..
  16. Upvote
    AnnieRuru reacted to Cydh in @item item_deny   
    just a little improvement if u want (I ever made this for my own server)
    instead of loading item each command being used, always accessing MySQL, just load it once and reloaded by @reloaditemdb. use item flag to mark it as "this item cannot be @item/@refine/@etc etc by group level/id below `this`"
     
     
    EDIT: attaching file
    item_restriction.diff
  17. Upvote
    AnnieRuru got a reaction from Luffy in [HELP] Disguise Event Error.   
    the same with item namesit reads `name_english` field
    prontera,146,185,5 script kjdhfskjsdhf 100,{ dispbottom Red_Potion +""; end;}read as 501 
    I remember when they did this, it breaks lilith's extended vending system
    http://herc.ws/board/tracker/issue-7525-set-variable-is-not-recognized-causing-freezing
    lilith's extended vending system put zeny and cashpoints as an item,
    after the fix you still get the warning message, but the lilith's patch will still work regardless
  18. Upvote
    AnnieRuru got a reaction from Jedzkie in Disabled 3rd Jobs and Baby 3rd jobs in @jobchange/@job command   
    there are 2 places, 1 for string, the other for numbers
    src/map/atcommand.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex b5e8fa7..958addb 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -951,7 +951,7 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){ if (strncmpi(message, pc->job_name(i), 16) == 0) { job = i;- found = true;+ found = false; } } @@ -973,8 +973,12 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { return true; } - if (pcdb_checkid(job)) {- if (pc->jobchange(sd, job, upper) == 0)+ if ( pcdb_checkid(job) ) {+ if ( job & JOBL_UPPER || upper == 1 ) {+ clif->message(fd, msg_txt(155)); // You are unable to change your job.+ return false;+ }+ else if (pc->jobchange(sd, job, upper) == 0) clif->message(fd, msg_txt(12)); // Your job has been changed. else { clif->message(fd, msg_txt(155)); // You are unable to change your job.
  19. Upvote
    AnnieRuru got a reaction from Kairedia in Maintenance mode   
    Download: 1.5
    plugin
     
    create table maintenance ( id int primary key auto_increment, account_id int, name varchar(23), reason varchar(99), minlv2connect tinyint, order_time datetime, start_time datetime, end_time datetime ) engine = innodb;   .
    remember to enable HPMHooking to enable this modification
    plugins_list: [ /* Enable HPMHooking when plugins in use rely on Hooking */ "HPMHooking", .
    .
    Note:
    sometimes the server countdown jumps 1 second ahead
    this is normal because the timetick from time->add is unstable
    so I use unix_time to synchronize the countdown to server time
     
    .
    .
    so, if you found some script/source code having bugs and you need to shut down your server for a short while
    then you come to the right place
    .
    @maintenance <Group ID can stay 1~99> <duration to kick in minute> <maintenance duration in minute> <reason> then a GM99 can commence the maintenance
     
    Example : '@maintenance 40 5 10 need to fix announcer script'
     
    every player with group ID 40 and below will be kick after 5 minutes
    and the server will start counting down by an announcement,
    during the maintenance of 10 minutes, group ID 40 and below will deny from login into the server
    `maintenance` table will also generate a new line, with the `reason` field as 'need to fix announcer script'
    which is useful to know when and how many times you did emergency server shutdown
    though, the actual reason for using SQL is to persist the data after server shutdown
    so the server will continue being in maintenance mode despite how many times you have shut down the server
    until it times up ( `end_time` field ), or manually do `@maintenanceoff`
     
    Note:
    you can't generate a new line using 'INSERT INTO' Sql syntax when server is online
    because I declare a bunch of variables to for them, for the purpose of saving memory consumption
    you have to login the game and type `@maintenance` to initiate the maintenance mode, otherwise it wont work.
    .
    .
    .
    @maintenanceoff if you have already finished fixing the script/source code, and there's still a lot of time left
    you can type '@maintenanceoff' to immediately turn off the maintenance mode so players can login before the schedule.
    .
    .
    .
    .
    -- Script commands --
    .
    *maintenance <Group ID can stay 1~99>, <duration to kick in minute>, <maintenance duration in minute> { , <reason> }; .
    .
    actually I have no idea why I wanna make a script command ... maybe just for fun ?
    .
    - script jsdfksdj FAKE_NPC,{ OnMon0255: maintenance 40, 5, 60; end; } .
    this will make an announcement on Monday, 2:55AM that the server will have a regular server maintenance starts from 3AM to 4AM
    during that time, player with group ID 40 will be kicked and blocked from entering the server
    the `reason` field in `maintenance` table will be defaulted to '*Regular server maintenance*'
    .
    maintenance 40, 5, 60, "系统保养";
    this will overwrite the `reason` field in `maintenance` table to '系统保养' instead of regular maintenance
    .
    .
    *maintenanceoff { <reason> }; uhh ... useless I think ...
    .
    .
    *maintenancecheck( <type> ); use 'maintenance()' to check the server is currently in maintenance mode or not
    return 0 if server is normal
    return 1 if server is going to have maintenance
    return 2 if server is having maintenance
    all other types are meant to myself to debug this junk
     
     
     
     
  20. Upvote
    AnnieRuru got a reaction from aszrool in Maintenance mode   
    Download: 1.5
    plugin
     
    create table maintenance ( id int primary key auto_increment, account_id int, name varchar(23), reason varchar(99), minlv2connect tinyint, order_time datetime, start_time datetime, end_time datetime ) engine = innodb;   .
    remember to enable HPMHooking to enable this modification
    plugins_list: [ /* Enable HPMHooking when plugins in use rely on Hooking */ "HPMHooking", .
    .
    Note:
    sometimes the server countdown jumps 1 second ahead
    this is normal because the timetick from time->add is unstable
    so I use unix_time to synchronize the countdown to server time
     
    .
    .
    so, if you found some script/source code having bugs and you need to shut down your server for a short while
    then you come to the right place
    .
    @maintenance <Group ID can stay 1~99> <duration to kick in minute> <maintenance duration in minute> <reason> then a GM99 can commence the maintenance
     
    Example : '@maintenance 40 5 10 need to fix announcer script'
     
    every player with group ID 40 and below will be kick after 5 minutes
    and the server will start counting down by an announcement,
    during the maintenance of 10 minutes, group ID 40 and below will deny from login into the server
    `maintenance` table will also generate a new line, with the `reason` field as 'need to fix announcer script'
    which is useful to know when and how many times you did emergency server shutdown
    though, the actual reason for using SQL is to persist the data after server shutdown
    so the server will continue being in maintenance mode despite how many times you have shut down the server
    until it times up ( `end_time` field ), or manually do `@maintenanceoff`
     
    Note:
    you can't generate a new line using 'INSERT INTO' Sql syntax when server is online
    because I declare a bunch of variables to for them, for the purpose of saving memory consumption
    you have to login the game and type `@maintenance` to initiate the maintenance mode, otherwise it wont work.
    .
    .
    .
    @maintenanceoff if you have already finished fixing the script/source code, and there's still a lot of time left
    you can type '@maintenanceoff' to immediately turn off the maintenance mode so players can login before the schedule.
    .
    .
    .
    .
    -- Script commands --
    .
    *maintenance <Group ID can stay 1~99>, <duration to kick in minute>, <maintenance duration in minute> { , <reason> }; .
    .
    actually I have no idea why I wanna make a script command ... maybe just for fun ?
    .
    - script jsdfksdj FAKE_NPC,{ OnMon0255: maintenance 40, 5, 60; end; } .
    this will make an announcement on Monday, 2:55AM that the server will have a regular server maintenance starts from 3AM to 4AM
    during that time, player with group ID 40 will be kicked and blocked from entering the server
    the `reason` field in `maintenance` table will be defaulted to '*Regular server maintenance*'
    .
    maintenance 40, 5, 60, "系统保养";
    this will overwrite the `reason` field in `maintenance` table to '系统保养' instead of regular maintenance
    .
    .
    *maintenanceoff { <reason> }; uhh ... useless I think ...
    .
    .
    *maintenancecheck( <type> ); use 'maintenance()' to check the server is currently in maintenance mode or not
    return 0 if server is normal
    return 1 if server is going to have maintenance
    return 2 if server is having maintenance
    all other types are meant to myself to debug this junk
     
     
     
     
  21. Upvote
    AnnieRuru reacted to Garr in Maintenance mode   
    /* Enable HPMHooking when plugins in use rely on Hooking */ //"HPMHooking", There's your problem. This plugin uses hooking.
  22. Upvote
    AnnieRuru got a reaction from Nova in Chat space limitation!/Scammer avoid *Will pay for help*   
    I'm more interested to know how to type those charactersAlt + ????
     
    those are actually meant for names
    use together with
    normalize_name( message, "255xA0032tx0Ax0D " );they are automatically trim into 1 single space 
    oh well
    patch
    src/map/clif.c | 7 +++++++ 1 file changed, 7 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..0118856 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -9110,6 +9110,13 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, *namelen_ = namelen; *message_ = message; *messagelen_ = messagelen;++ normalize_name( message, "255xA0032tx0Ax0D " );+ if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked+ clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );+ return false;+ }+ return true; } plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../map/pc.h"#include "../map/clif.h"#include "../common/HPMi.h"#include "../common/socket.h"#include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time)HPExport struct hplugin_info pinfo = { "GM_impersonate", // 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)};bool clif_process_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) { if ( retVal == true ) { char* message = (char*)RFIFOP( sd->fd ,4) + strnlen(sd->status.name, NAME_LENGTH-1) + 3; normalize_name( message, "255xA0032tx0Ax0D " ); if ( stristr( message, "x20x3Ax20" ) || stristr( message, "x20x3Bx20" ) ) { // type " : " OR " ; " will be blocked clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" ); return false; } } return true;}HPExport void plugin_init (void) { clif = GET_SYMBOL("clif"); session = GET_SYMBOL("session"); strlib = GET_SYMBOL("strlib"); addHookPost("clif->process_message", clif_process_message_spaces);}
  23. Upvote
    AnnieRuru reacted to Cydh in Maintenance mode   
    for rAthena, u can do simply trick
    [*]just do normal announcement "/b I gonna do maintenance bla bla bla"
    [*]"@kickall"
    [*]with a little modification on char & login server (see my PR on rA "server:reloadconf"
    [*]edit the configs that have mean to "only this group level above can login"
    [*]on your char & login server console, (make sure console:yes for both servers) just go type "server:reloadconf"

    ehh, the proper sort is 3-1-4-5-2.
     
    @Annie
    instead of use 0 here, u should use INVALID_TIMER (and other lines)
    +       if ( chrif->maintenance_countid > 0 ) {+               timer->delete( chrif->maintenance_countid, chrif->maintenance_countdown );+               chrif->maintenance_countid = 0; +       }
  24. Upvote
    AnnieRuru reacted to GmOcean in Stock NPC   
    I thought about it, but I figured with a script like this you wouldn't want it to reset if server crashed or went down for any reason. You know, cuz there must be a reason why there is only 30,000 available lol. If I were to use npcvars instead of permglobals then there would be a very likely chance of more floating in circulation upon an abrupt server down time D:
  25. Upvote
    AnnieRuru reacted to THPO in Maintenance mode   
    Test it with Windows MSVC no problem., but when I tried with CentOS I get an error return while compiling:
     
    Ok seems working now with centos I just added on include:
    with little warnings and could be ignored. 
     
    Thanks again AnnieRuru.
×
×
  • Create New...

Important Information

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