Jump to content

Angelmelody

Members
  • Content Count

    772
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by Angelmelody


  1.  

     

    if( gettimetick(2) < lastTimeTalked ) {mes "You talked recently";close;} else {set lastTimeTalked, gettimetick(2) + ( 3600 * 24 );mes "You may not talk to me again for 24 hours.";close;}

    I'm assuming you mean something like this?

    If so, then your problem is you didn't actually set ' lastTimeTalked ' to anything. So, you were trying to check if gettimetick(2) - 0 would be greater than ( 60 * 60 * 24 ) [24 hours]. Which of course it will be since it's a number that goes up every second since 1950? 1960?. At anyrate, as long as you set the variable to current time ( gettimetick(2) ) plus 24 hours, then you won't have an issue.

    no sir i mean i want the script be like " You have 2 hrs left to claim another prize"

     

     try this

    if( set(.@t, (gettimetick(2) - lastTimeTalked)) < 86400 ) {	mes "Sorry:( you can wish again after"+callfunc("Time2Str", (86400-.@t));	mes "24 hours are over";} else {	mes "Okay have fun with it!";	set lastTimeTalked, gettimetick(2);}close;

  2.  

    This can be done via script i forgot where i get it.... or who made it but credits to them.

    -    script    MapRecall    -1,{    OnInit:        bindatcmd "maprecall",strnpcinfo(3)+"::OnMapRecall",70,70;        end;    OnMapRecall:        if(getgmlevel()==0) end;        getmapxy .@map$,.@x,.@y,0;        mapwarp .@map$,.@map$,.@x,.@y,0;}

     

    Hello! how can I avoid @autotrade players to be @maprecalled?

    we dont need that command becoz we have  getmemberaid

     

     usage: @maprecall "mapname"

    -    script    MapRecall    -1,{end;OnInit:	bindatcmd "maprecall",strnpcinfo(3)+"::OnMapRecall",70,70;end;OnMapRecall:	.@smap$ =,.@atcmd_parameters$[1];	if(getmapusers(.@smap$) == -1) {		mes "invalid map name..";		close;	}	getmapxy(.@tmap$,.@tx,.@ty,0);	getmemberaid ALL_SAMEMAP, .@smap;	for ( .@i = 0; .@i < $@onlinecount; .@i++ ) {		if(!attachrid($@onlineaid[.@i])) continue;		if(!checkvending()) warp(.@tmap$, .@tx, .@ty);				}	end;		}

     

     

     

     


  3. That's odd, I thought it counts null string as a null and shouldn't pull this off. Find:

    	if (flag && nm->nmask ) {		memcpy(WBUFP(buf,6), nm->nmask, NAME_LENGTH);	} else {		memcpy(WBUFP(buf,6), ((TBL_NPC*)bl)->name, NAME_LENGTH);	}
    And replace with
        if (flag && nm->nmask != "0") {        memcpy(WBUFP(buf,6), nm->nmask, NAME_LENGTH);    } else {        memcpy(WBUFP(buf,6), ((TBL_NPC*)bl)->name, NAME_LENGTH);    }
     

     

    EDIT: Updated upaste link in opening post.

     

     

    Thanks, but still display empty name if you dont provide param <new name>

     

     my method is to use nd->name

    if ( script_hasdata(st,8) ) {if ( script_isstringtype(st,8) ) {varn2 = script_getstr(st,8);safestrncpy(nm->nmask, varn2, NAME_LENGTH);}} else {safestrncpy(nm->nmask, nd->name, NAME_LENGTH);}
     then
    			if (flag && nm->nmask ) 				memcpy(WBUFP(buf,6), nm->nmask, NAME_LENGTH);			else				memcpy(WBUFP(buf,6), nd->name, NAME_LENGTH);
     

     

    ,and then I m a little bit nosy, and think it would be better if just use removeFromNPCD , hope you dont mind :)

     

     

    BUILDIN(npcunmask) {	struct npc_mask *nm;	struct npc_data *nd;	if( script_hasdata(st,2) )		nd = npc->name2id(script_getstr(st,2));	else 		nd = map->id2nd(st->oid);	if( nd == NULL ) {		script_pushint(st,-1); //No such NPC;		return true;	}	if((nm = getFromNPCD(nd,0)))		removeFromNPCD(nd,0);	script_pushint(st,1);	return true;}

     

    btw,hookstop must be inside an if-condition or you will cause unnecessary trouble

     

     

    if ((nm = getFromNPCD(nd,0))) {............hookStop();}

     

     

    for example

     

    	if (bl->type == BL_NPC){		struct npc_data *nd = (TBL_NPC*)bl;		struct npc_mask *nm;		if ((nm = getFromNPCD(nd,0))) {			unsigned char buf[103];			int var;			bool flag = false;			WBUFW(buf,0) = 0x95;			WBUFL(buf,2) = bl->id;			var = pc_readglobalreg(sd, script->add_str(nm->varname));			if ( nm->masked && nm->compare) { //Not checking var or nm->value1/2 to make usage of variables resulting in 0 possible, or to compare with 0.				if (nm->compare&CMP_LESS && var < nm->value1)					flag = true;				if (nm->compare&CMP_EQU && var == nm->value1)					flag = true;				if (nm->compare&CMP_MORE && var > nm->value1)					flag = true;				if ( nm->compare&CMP_BETWEEN && var >= nm->value1 && var <= nm->value2 )					flag = true;				if ( nm->compare&CMP_EXCLUDE && (var < nm->value1 || var > nm->value2) )					flag = true;			}			if (flag && nm->nmask ) 				memcpy(WBUFP(buf,6), nm->nmask, NAME_LENGTH);			else				memcpy(WBUFP(buf,6), nd->name, NAME_LENGTH);				WFIFOHEAD(sd->fd, 30);			memcpy(WFIFOP(sd->fd, 0), buf, 30);			WFIFOSET(sd->fd, 30);			hookStop();				}	}

     


  4.  

    Hmm, try adding this

    #define pcdb_checkid_sub(class_) ( 	( (class_) <  JOB_MAX_BASIC ) ||	( (class_) >= JOB_NOVICE_HIGH    && (class_) <= JOB_DARK_COLLECTOR ) ||	( (class_) >= JOB_RUNE_KNIGHT    && (class_) <= JOB_MECHANIC_T2    ) ||	( (class_) >= JOB_BABY_RUNE      && (class_) <= JOB_BABY_MECHANIC2 ) ||	( (class_) >= JOB_SUPER_NOVICE_E && (class_) <= JOB_SUPER_BABY_E   ) ||	( (class_) >= JOB_KAGEROU        && (class_) <= JOB_OBORO          ) ||	( (class_) >= JOB_REBELLION      && (class_) <  JOB_MAX            ) )#define pcdb_checkid(class_) pcdb_checkid_sub((unsigned int)(class_))
    inside. What version are you using to compile?

    my git version is 9ab4f84 and compiling under MSVC 2010

     

    I comment out all the nullpo_retv(bl) lines , compiling is successful now

     

    edit :

    report a bug

    <new name> - name masking, if not provided will use empty name.

    my test script

    npcmask 1002,"abc",0x02,1,2,2;

  5.  

    I see that you copied it into some kind of bigger plugin for scripting, maybe you missed the enum part? Make sure it's there:

    enum compare_method {	CM_NONE = 0x00,	CM_LESS = 0x01,	CM_EQU = 0x02,	CM_MORE = 0x04,	CM_BETWEEN = 0x10,	CM_EXCLUDE = 0x20,	CM_MAX = 0x37,} c_m;
    Otherwise I'm somewhat at a loss why it'd throw that at you.

    Nope,I'm pretty sure that enum exists....

     

    I try to replace CM_  with CMP ,then those compile warnings dispear ,but still have another warnings

    enum compare_method {    CM_NONE = 0x00,    CM_LESS = 0x01,    CM_EQU = 0x02,    CM_MORE = 0x04,    CM_BETWEEN = 0x10,    CM_EXCLUDE = 0x20,    CM_MAX = 0x37,} c_m;
    enum compare_method {    CMP_NONE = 0x00,    CMP_LESS = 0x01,    CMP_EQU = 0x02,    CMP_MORE = 0x04,    CMP_BETWEEN = 0x10,    CMP_EXCLUDE = 0x20,    CMP_MAX = 0x37,} ;

     

    another warnings :

     

    1>------ Rebuild All started: Project: plugin-script, Configuration: Debug Win32 ------

    1> pscript.c

    1> Creating library ..pluginsplugin-script.lib and object ..pluginsplugin-script.exp

    1>pscript.obj : error LNK2019: unresolved external symbol _assert_report referenced in function _clif_set_unit_idle_hooked

    1>..pluginsplugin-script.dll : fatal error LNK1120: 1 unresolved externals

    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

     


  6. Added in upaste mirror. And it's a plugin, used with HPM. If there will be requests of such I might make a source mod diff for it, but not today.

    I got these compile warnings
    1>d:hercsrcpluginspscript.c(1273): error C2065: 'CM_LESS' : undeclared identifier1>d:hercsrcpluginspscript.c(1275): error C2065: 'CM_EQU' : undeclared identifier1>d:hercsrcpluginspscript.c(1277): error C2065: 'CM_MORE' : undeclared identifier1>d:hercsrcpluginspscript.c(1279): error C2065: 'CM_BETWEEN' : undeclared identifier1>d:hercsrcpluginspscript.c(1281): error C2065: 'CM_EXCLUDE' : undeclared identifier1>d:hercsrcpluginspscript.c(1375): error C2065: 'CM_LESS' : undeclared identifier1>d:hercsrcpluginspscript.c(1377): error C2065: 'CM_EQU' : undeclared identifier1>d:hercsrcpluginspscript.c(1379): error C2065: 'CM_MORE' : undeclared identifier1>d:hercsrcpluginspscript.c(1381): error C2065: 'CM_BETWEEN' : undeclared identifier1>d:hercsrcpluginspscript.c(1383): error C2065: 'CM_EXCLUDE' : undeclared identifier1>d:hercsrcpluginspscript.c(1431): error C2065: 'CM_LESS' : undeclared identifier1>d:hercsrcpluginspscript.c(1431): error C2065: 'CM_LESS' : undeclared identifier1>d:hercsrcpluginspscript.c(1432): error C2065: 'CM_EQU' : undeclared identifier1>d:hercsrcpluginspscript.c(1432): error C2065: 'CM_EQU' : undeclared identifier1>d:hercsrcpluginspscript.c(1433): error C2065: 'CM_MORE' : undeclared identifier1>d:hercsrcpluginspscript.c(1433): error C2065: 'CM_MORE' : undeclared identifier1>d:hercsrcpluginspscript.c(1434): error C2065: 'CM_BETWEEN' : undeclared identifier1>d:hercsrcpluginspscript.c(1436): error C2065: 'CM_BETWEEN' : undeclared identifier1>d:hercsrcpluginspscript.c(1441): error C2065: 'CM_EXCLUDE' : undeclared identifier1>d:hercsrcpluginspscript.c(1443): error C2065: 'CM_EXCLUDE' : undeclared identifier1>d:hercsrcpluginspscript.c(1493): error C2065: 'CM_LESS' : undeclared identifier1>d:hercsrcpluginspscript.c(1493): error C2065: 'CM_LESS' : undeclared identifier1>d:hercsrcpluginspscript.c(1494): error C2065: 'CM_EQU' : undeclared identifier1>d:hercsrcpluginspscript.c(1494): error C2065: 'CM_EQU' : undeclared identifier1>d:hercsrcpluginspscript.c(1495): error C2065: 'CM_MORE' : undeclared identifier1>d:hercsrcpluginspscript.c(1495): error C2065: 'CM_MORE' : undeclared identifier1>d:hercsrcpluginspscript.c(1496): error C2065: 'CM_BETWEEN' : undeclared identifier1>d:hercsrcpluginspscript.c(1498): error C2065: 'CM_BETWEEN' : undeclared identifier1>d:hercsrcpluginspscript.c(1503): error C2065: 'CM_EXCLUDE' : undeclared identifier1>d:hercsrcpluginspscript.c(1505): error C2065: 'CM_EXCLUDE' : undeclared identifier========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

  7. xxxx    script xxxx    xxx,{.@m$ = strcharinfo(3);for(.@i=0;.@m$ != .yourarray$[.@i] && .@i< .size ; i++);if(.@i<.size) {    got it!}Oninit:setarray .yourarray$,"XXX","yyy" "zzz";.size = getarraysize(.yourarray$);} 

  8. Oh? I like the sound of this.  I never really used this because it was limited to ratio drop rate. But with a fixed rate option that'd be useful, I could remove the use of the scripts I use to simulate it.

    But, I feel that this would still be missing 1 more optional field: Mapname.

    So that we can specify What Item, and what rate, that rate, the monster, and the map that it should only affect.

     

    To use the same example of above:

    909,0,100,1002 // Jellopies from ALL Porings will drop with a 1x ratio drop rate.

    909,1,100,1002, pay_fild04 // Jellopies from Porings on the map pay_fild04 will drop with a 0.1% fixed drop rate.

     

    Yeah~,This config archive was unpopular,most of users like you nerver use

     

    this archive,but just did a little bit improvement that will become more popular


  9. this new eathena host sux ...

     

    does anyone experience this ?

    1. login eathena forum -> 20 seconds

    2. click search button -> 20 seconds

    3. after input the thing I want to search, wait for the result -> 30 seconds

    4. click on 1 of the topic on the result -> opening a new window, another 20 seconds

    total time = 1.5 minute

    oh wait .. that's not the topic I want, I click on another topic in the search result, maybe that's the topic I'm looking for

    another 20 seconds

     

    this is driving me nuts

     

    I have 6.7k post count in eathena forum and still left a lot of information there

    My test results:

    Linking in the daytime EA forum was lag like you said,but linking at night forum works smoothly


  10.  

     

    I think your request require a source mod.

     

    try this

     

    pc.c

     

    inside the pc_insert_card() function

     

     int csc;//add this declaration

     

     

    find

        // remember the card id to insert    nameid = sd->status.inventory[idx_card].nameid;

    add after

        for(i=0;i<sd->inventory_data[idx_equip]->slot;i++){        if(nameid == sd->status.inventory[idx_equip].card[i])            csc++;    }    if(csc>=2)        return 0

    i got error 

    Error	1	error C2065: 'csc' : undeclared identifier	c:usersadmindesktoprathenasrcmappc.c	3737	1	map-server_sql

    you forgot to  declare that  variable


  11. Is there a possilbe to add an additonal flag field which determine the value in next field is fixed drop

    rate or ratio drop rate ?

    Structure looks like this
    ItemID,Flag, fixed/ratio drop rate{,MonsterID}

    For example, If flag was set to 0 ,We can specify ratio drop rate of certain item to a mob or all mob
    or if flag was set to 1 , We can specify fixed drop rate to mob....

     

    909,0,100,1002 // Jellopies from Porings will drop with 1x ratio drop rate.

    909,1,100,1002 // Jellopies from Porings will drop with 0.1 fixed drop rate. (100/1000=0.1)
     


  12. http://herc.ws/board/topic/7127-maintenance-mode/?p=43750

    ask Hadeszeus is his sscanf is really working fine or not

    because that also works fine in my test server

     

    I know I'm being sarcastic, and love to do string calculation hahaha

    or actually I just simply hate people posting error ... error ... on my topic, kinda spoiled my reputation

     

    in msvc2010, sscanf will throw error, saying need to use s_sscanf

    then if you use s_sscanf, then other members who are not using mscv will get an error ...

    very annoying

    but when calculate the string, everybody happy

    all those s_xxxx.. annoying warnings in my plugin projects were disabled  by me , coz I hate those

     

     

    1.

    right click your plugin project--> choose properties--> configuration properties--> Preprocessor-->Preprocessor Definition -->edit

     

     

    q3rN3yHS.png

     

     

    2. input the below two lines

    _CRT_SECURE_NO_DEPRECATE

    _SCL_SECURE_NO_DEPRECATE

     

     

    yb9yJtFw.jpg

     

     

     

    3 push ok and apply button

     

     


  13. omfg ... forgot to add pc-> symbol

     

     

    EDIT- modify existing paste is very useful ...

     

    sscanf  now works for me 

     

    find 

     

    if ( sscanf( message, ""%[^"]" "%[^"]"", title, msg ) < 2 ) {

     

    change to

     

    if ( sscanf( message, ""%256[^"]" "%256[^"]"", title, msg ) < 2 )


  14.  

    this patch make Extended Vending System to support @AT vendor

    but only for those who had already patched 14935.patch

     

     

     attachicon.gif@at support.patch

     

     

     

     run the below sql command to update your autotrade_merchants table

    ALTER TABLE `autotrade_merchants` ADD COLUMN `currency_id` smallint(6) NOT NULL DEFAULT '0' AFTER `title`;

     

     

     

     

    hy Angel about the zeny & cash issue where server think its as item can you reproduce it ?

    I just change Aegis name 'Zeny'  to  'IZeny' and  'Cash' to 'ICash' ,I dont get any warning

     

    {    Id: 30000    AegisName: "IZeny"    Name: "金錢"    Type: 3    Sell: 0    Weight: 1},{    Id: 30001    AegisName: "ICash"    Name: "商城點數"    Type: 3    Sell: 0    Weight: 1},

  15. Hi~Annie,I'd like to report an  issue:

     

    if you kill clone via @killmonster command(still working) ,and then log out your Character , map server will get crashed

     

    edit : I m using plugin v1.1

    I try building a hooking function to prevent the market clone killed by @killmonster CMD
    int atkillmonster_sub_pre(struct block_list *bl, va_list *ap){	struct mob_data *md;	struct monster_data *mmd;	md = (struct mob_data *)bl;		if ( ( mmd = getFromMOBDATA( md, 0 ) ) ) {		if(mmd->market_chat_id){			hookStop();			return 0;		}	}	return 1;}addHookPre( "atcommand->atkillmonster_sub", atkillmonster_sub_pre );
×
×
  • Create New...

Important Information

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