Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    247

Posts posted by AnnieRuru


  1. kinda getting nostalgic when playing an old battleground, so I load this src to play

    I just changed line 71 into

    int status_change_end_post( int retVal, struct block_list *bl, enum sc_type type, int tid ) {

    and it works

     

     

    On 7/21/2020 at 9:54 AM, Samuel said:

    - Status changes shows the additional buff strings

    can elaborate more ?

    and for the other bug, I'm not sure this can even be fix from server side
    right click to 1:1 whispering is client side thingy I guess

     

     

    but I think this is most useful when showing a small window like this

    screen2020Hercules001.jpg

     

     

    also means those who have client crashing etc, nope I think this is actually built for this feature

    (although I found this was made even before 2013 ??)


  2. 24 minutes ago, evilpuncker said:

    is it possible to run only the Buff part from the clans.conf by something like sc_start SC_CLAN_INFO

    OnPCStatCalcEvent ?

     

    prontera,155,185,5	script	fhdskdjf	1_F_MARIA,{
    	mes "join annieruru fan club";
    	next;
    	if (select("Yes","No") == 2) close;
    	#annie_fan_club = true;
    	close2;
    	recalculatestat;
    	end;
    OnPCStatCalcEvent:
    	if (!#annie_fan_club) end;
    	bonus bAllStats, 100; // Makes you imba
    	end;
    }

     


  3. yes this is indeed confusing

     

    the one in the source code

    source <----> script

    (sd->job & JOBL_THIRD) != 0 <----> (eaclass() & EAJ_THIRD) != 0

    (sd->job & MAPID_BASEMASK) != MAPID_NOVICE <----> (eaclass() & EAJ_BASEMASK) != EAJ_NOVICE

     

    now assuming that your script has correct logic

    script <----> source

    !(eaclass() & EAJL_THIRD)  <----> !(sd->job & JOBL_THIRD)

    BaseJob == Job_SuperNovice <----> (sd->job & MAPID_UPPERMASK) == MAPID_NOVICE (note there are no basejob in source code) (do not confuse EAJL_UPPER - EAJ_UPPERMASK)

    Class != Job_Star_Gladiator <----> sd->status.class != Job_Star_Gladiator

    Class != Job_Soul_Linker <----> sd->status.class != Job_Soul_Linker

     

     

    I think what you want is

    1. all 3rd jobs can access this npc

    2. super novice entended (4190 - Job_Super_Novice_E) cannot use this npc

    3. also allow Job_Star_Gladiator and Job_Soul_Linker to access the npc

     

    prontera,155,185,5	script	debug_test_job	1_F_MARIA,{
    	mes "select a few job to test the condition";
    	next;
    	switch(select(
    		"Job_Novice - NO",
    		"Job_SuperNovice - NO",
    		"Job_Novice_High - NO",
    		"Job_Super_Novice_E - NO",
    		"Job_Super_Baby - NO",
    		"Job_Super_Baby_E - NO",
    		"Job_Acolyte - NO",
    		"Job_Priest - NO",
    		"Job_High_Priest - NO",
    		"Job_Baby_Priest - NO",
    		"Job_Arch_Bishop - YES",
    		"Job_Arch_Bishop_T - YES",
    		"Job_Baby_Bishop - YES",
    		"Job_Soul_Linker - YES",
    		"Job_Star_Gladiator - YES")) {
    	case 1: jobchange Job_Novice; break;
    	case 2: jobchange Job_SuperNovice; break;
    	case 3: jobchange Job_Novice_High; break;
    	case 4: jobchange Job_Super_Novice_E; break;
    	case 5: jobchange Job_Super_Baby; break;
    	case 6: jobchange Job_Super_Baby_E; break;
    	case 7: jobchange Job_Acolyte; break;
    	case 8: jobchange Job_Priest; break;
    	case 9: jobchange Job_High_Priest; break;
    	case 10: jobchange Job_Baby_Priest; break;
    	case 11: jobchange Job_Arch_Bishop; break;
    	case 12: jobchange Job_Arch_Bishop_T; break;
    	case 13: jobchange Job_Baby_Bishop; break;
    	case 14: jobchange Job_Soul_Linker; break;
    	case 15: jobchange Job_Star_Gladiator; break;
    	default: mes "go die"; close;
    	}
    	message getcharid(CHAR_ID_ACCOUNT), jobname(Class);
    	close;
    OnInit:
    	bindatcmd "@test2", strnpcinfo(NPC_NAME_UNIQUE)+"::Onaaa";
    	end;
    Onaaa:
    	.@eaclass = eaclass();
    	if (((.@eaclass & EAJL_THIRD) != 0 && (.@eaclass & EAJ_BASEMASK) != EAJ_NOVICE) || Class == Job_Soul_Linker || Class == Job_Star_Gladiator) // this line you want
    		dispbottom "Yes";
    	else
    		dispbottom "No";
    	end;
    }

     

    #include "common/hercules.h"
    #include "map/pc.h"
    #include "map/clif.h"
    #include "plugins/HPMHooking.h"
    #include "common/HPMDataCheck.h"
    
    HPExport struct hplugin_info pinfo = {
    	"test",
    	SERVER_TYPE_MAP,
    	"",
    	HPM_VERSION,
    };
    
    ACMD(test) {
    	if (((sd->job & JOBL_THIRD) != 0 && (sd->job & MAPID_BASEMASK) != MAPID_NOVICE) || sd->status.class == JOB_SOUL_LINKER || sd->status.class == JOB_STAR_GLADIATOR)
    		clif->message(sd->fd, "Correct");
    	else
    		clif->message(sd->fd, "Wrong");
    	return true;
    }
    
    HPExport void plugin_init (void) {
    	addAtcommand("test", test);
    }

     

     

    8 hours ago, evilpuncker said:

    btw why don't we have an official has_second_costume script command though, so we don't need to repeat code :P 

    not a popular script command ?

    I even feel lazy to make a plugin for this script command, just return true/false


  4. oh ok, you are partially right when it kick excess guild members

    but it isn't the way you claimed that it count from other guild members

     

    upon close inspection, @astralprojection script has 2 problems which is

    1. if the player has multiple characters from the same account join the same guild, it count multiple times instead of 1, it doesn't extend the isloggedin into $@guildmembercid check

    2. it checks as long as the guild member enter ANY CASTLE map, not that particular castle map

     

    try this one

    https://gist.github.com/AnnieRuru/339e268a8be5370fa7ae1aa2f856ca28


  5. setd "#Attendance_" + gettime(DT_YYYYMMDD),true;

    bad script design

     

    let's say the player has attended this script for 300 days, then it will have 299 unnecessary variables pile up in `acc_reg_num_db` table

    this kind of variable only use once, so set only 1 variable enough, with the value on date format

     

     

    no.2

    from my understanding, your script even use loop ... why not just use gettimetick(2)

    when login, `@timelogin` = gettimetick(2), when npc check, (gettimetick(2) - `@timelogin`) ....

     

     

    no,3

    and why not just write everything with source code =/

    no need loop, every variable and function you want is readily served in source code

     

    nvm, let me show you if its done entirely with source code

    https://gist.github.com/AnnieRuru/82335a62e8a6133511cda473ade8d322

     

     

    oh and, my discord is AnnieRuru#1609

     


  6. https://upaste.me/691b80

    emistry's script should work though ...

     

    -	script	Sample	FAKE_NPC,{
    OnPCLoadMapEvent:
    	.@map$ = strcharinfo(PC_MAP);
    	.@guild_id = getcharid(CHAR_ID_GUILD);
    
    	if (getmapflag(.@map$, MF_GVG_CASTLE) && .@guild_id) {
    		if (getmapguildusers( .@map$,.@guild_id ) > 2){
    			mes "Max Guild Member can stay on this map exceed.";
    			close2;
    			warp "prontera",155,181;
    		}
    	}
    	end;
    }
    
    aldeg_cas01	mapflag	gvg_castle
    aldeg_cas01	mapflag	loadevent

     

    now astralprojection's script

    .... also works when set .max, 2; ...

     

    ... I have no idea why doesn't work for you,

    - I open 6 client, 3 client join guild A, other 3 client join guild B

    - guild A only can only enter 2 guild members, guild B also only can enter 2 guild members, always 1 getting kick

     

    if it doesn't work this way, then what is the behavior you want ?


  7. prontera,152,188,5	script	test getitemname2	1_F_MARIA,{
    	setarray .@a, 1101, 5, 0, 0, 4003, 4003;
    	mes callfunc("getitemname2", .@a[0], 1, .@a[1], 0, .@a[2], .@a[3], .@a[4], .@a[5]);
    	mes callfunc("F_ITEML", .@a[0], .@a[1], .@a[2], .@a[3], .@a[4], .@a[5]);
    	close;
    }

    I'm not sure needs to even needs to update this script or not, because <ITEML> function can do exact same thing

     

    ... but the colorize message box seems very tempting .... meh ...

     

    2.6 - script

    - fix a bug when you have only 1 card inserted, it shows Triple <blank>, now the blank slot no longer calculate

    - fix a bug for missing line getiteminfo(ITEMINFO_SUBTYPE) when having identify flag off

     


  8. prontera,155,185,5	script	kjhfkhsjd	1_F_MARIA,{
    //	#Attendance_require = 0;
    //	end;
    
    	mes callsub(YYYYMMDD);
    	#Attendance_require = callsub(YYYYMMDD);
    	close;
    YYYYMMDD:
    	return gettime(GETTIME_YEAR) * 10000 + gettime(GETTIME_MONTH) * 100 + gettime(GETTIME_DAYOFMONTH);
    }
    #include "common/hercules.h"
    #include "map/pc.h"
    #include "map/clif.h"
    #include "plugins/HPMHooking.h"
    #include "common/HPMDataCheck.h"
    
    HPExport struct hplugin_info pinfo = {
    	"attendance_requirement",
    	SERVER_TYPE_MAP,
    	"",
    	HPM_VERSION,
    };
    
    // copy from src\map\date.c
    int date_get_date(void)
    {
    	time_t t;
    	struct tm * lt;
    	t = time(NULL);
    	lt = localtime(&t);
    
    	return
    		(lt->tm_year + 1900) * 10000 +
    		(lt->tm_mon + 1) * 100 +
    		(lt->tm_mday);
    }
    
    static void clif_parse_attendance_reward_request_pre(int *fd, struct map_session_data **sd) {
    	if ((*sd)->state.trading || pc_isdead(*sd) || pc_isvending(*sd))
    		return;
    	
    	if (pc_readaccountreg(*sd, script->add_variable("#Attendance_require")) != date_get_date()) {
    		clif->messagecolor_self((*sd)->fd, COLOR_RED, "You don't meet the requirement.");
    		hookStop();
    	}
    	return;
    }
    
    HPExport void plugin_init (void) {
    	addHookPre(clif, pAttendanceRewardRequest, clif_parse_attendance_reward_request_pre);
    }

    this has been tested working

     

    btw remember the attendance system are bind to each character in the account

    https://github.com/HerculesWS/Hercules/blob/da14478a8c0c616a6aa5481694c550143bc9b9f3/sql-files/main.sql#L245-L246 <-- under `char` table

    so I guess what you doing there is the reward can claim for each character in the account once the quest has completed


  9. dastgir has been a big help trying to help maintain some of my plugins,

    but this one in particular, I see the version is 1.6, which means he miss the version 1.7 update

     

    Quote

    1.7 - plugin
    - fix memory leak for not removing the chatroom

    yup, the one you posted has memory leak problem because the chat-room doesn't remove properly

    eg: only remove the chat-room shown, but the memory still persist

    see the remove_chatroom function to see how to remove the chat-room from server memory properly

    ... which was copy paste from a function from chat.c

     

    anyway here is version 1.9

    https://github.com/AnnieRuru/Release/blob/master/plugins/marketclone/marketclone_1.9.c

     


  10. update to version 1.9

    plugin

    big thanks to dastgir to give some hints how to update this plugin

     

    On 7/15/2019 at 3:15 AM, Mihael said:

    Remove this.

    else { struct packet_reqnameall_ack packet = { 0 }; packet.packet_id = reqName; packet.gid = md->bl.id; memcpy( packet.name, md->name, NAME_LENGTH ); clif->send( &packet, sizeof(struct packet_reqname_ack), *bl, AREA ); hookStop(); return; }

    
    			else {
    				struct packet_reqnameall_ack packet = { 0 };
    				packet.packet_id = reqName;
    				packet.gid = md->bl.id;
    				memcpy( packet.name, md->name, NAME_LENGTH );
    				clif->send( &packet, sizeof(struct packet_reqname_ack), *bl, AREA );
    				hookStop();
    				return;
    			}

    and recompile you emulator.

    if you removed that, any server that has show_mob_info settings on, will allow players to see the level and hp of the mobs

    it seems the function has changed, now just need clif_mobname_ack to work


  11. I can't believe a simple script like this can get tons of errors, this is outside of my expectation

    I can't reproduce any of those 3 errors

     

    image.png.fa5d4c2b8a17e795ec287a647c1059

    how do you even get this error ?

     

     

     

    image.png.53e583b5bcd9ebde0f495ddb2dba6a

    this is even ridiculous, NPC_SELFDESTRUCTION should return number 173, not 150000
    ok, maybe its because this is rip from rathena, because rathena doesn't support Skill ID constant, so use the string input but still ...
    but how did your server can parse NPC_SELFDESTRUCTION as 1500000 in the first place ?

     

     

    if these 2 error are caused by *unitskilluseid, then try use *unitkill instead

    try 1 more time

    https://gist.github.com/AnnieRuru/4a87e0ab7451e671d0e3056aedd2a086/revisions

    https://gist.github.com/AnnieRuru/4a87e0ab7451e671d0e3056aedd2a086

     

     

     

     

    image.png.cae85c55846c2d14cdaa1733c6b78e

    no, e_omg are official constant,

    https://github.com/HerculesWS/Hercules/blob/stable/doc/constants.md#emotes

    don't try to change that to capital letters

    I get it now, reproduced with my rathena test server, so if you are using rathena, so nope, this script was made for hercules

    next time if you are using rathena, either say clearly in your 1st post, or have your username says you are using rathena emulator

     

     

     

    I take it as rathena script request ?

    7 hours ago, balanar12321 said:

    Thank you very much

    can help me one more like this? 
    in Disguise Event? thank you, 

    disguise.txt 8.28 kB · 1 download


  12. damn ... forgot to index the table properly

     

    3.2

    script

    - index the table properly

     

    for those who already have the script installed, index these keys to make the query return faster, specifically when viewing the top 10

    alter table pvpladder add key (`kills`);
    alter table pvpladder add key (`streaks`);
    alter table ownladder add key (`highestown`);

     

    and yeah, this is the base script for public releases

    any further modification, try ask here or open a new topic in script request ... or maybe as a paid request


  13. 22 minutes ago, 4144 said:

    windows always works different. probably best way for avoid windows and visual studio issues is drop visual studio support. and to use normal compilers...

    wow ... if hercules officially drop visual studio, I switch to rathena

     

    8 minutes ago, 4144 said:

    or simpler. try apply this patch to generate-translations.c

    - } else if (*p == PATHSEP) { + } else if (*p == PATHSEP || *p == '/') {

    
    -               } else if (*p == PATHSEP) {
    +               } else if (*p == PATHSEP || *p == '/') {
    

     

    yes, its working fine now

     

    now just wait topic starter also got it working or not


  14. version 2.9

    	sleep 1500;
    ...
    		if ( .announce ) mapannounce .@map$, "The guild ["+ getguildname(.@killer_gid) +"] is OWNING["+ getd(".dota_sql_"+ .@killer_gid +"_c") +"] !!!",16;
    		else announce "The guild ["+ getguildname(.@killer_gid) +"] is OWNING["+ getd(".dota_sql_"+ .@killer_gid +"_c") +"] !!!",16;
    ...
    	}

    I used .@killer_gid, which was set earlier, to save the killer's guild ID

    because the sleep script command will detach the RID

    	sleep 1500;
    ...
    		if ( .Announce ) mapannounce .@map$, "The guild ["+ getguildinfo(GUILDINFO_NAME, getcharid(CHAR_ID_GUILD)) +"] is OWNING["+ getd(".dota_sql_"+ .@killer_gid +"_c") +"] !!!",16;
    		else announce "The guild ["+ getguildinfo(GUILDINFO_NAME, getcharid(CHAR_ID_GUILD)) +"] is OWNING["+ getd(".dota_sql_"+ .@killer_gid +"_c") +"] !!!",16;
    ...
    	}

    of course the way you did it will cause map-server to spam error because after sleep, RID has detached

     

    anyway just download version 3.1, just released

     


  15. yeah I bet everyone still using version 2.9, that outdated version from eathena

    honestly there isn't much change with previous version, version 2.9 still works fine if you know how to fix it

     

    Download: 3.6

    hercules - script

    rathena - script

    soundeffect

     

     

    Spoiler

    2.9 - script

    widely circulate on both rathena and hercules forum

     

    3.0 - script

    - fix a bug for hercules, BaseLevel is case-sensitive

    - modernize the script

    --- remove all set/setd/getd

    --- looping the map change from for-loop into while-loop

    --- rework sit-killing variable, no longer have any loop or stupid 128 limit

     

    3.1 - script

    - optimized query_sql execution from 4 times to just twice in every single way
    - fix a bug sit-killing can cause value into negative
    - remove OnWhisperGlobal ... I don't really see any use case for it

     

    3.2 - script

    - index the table properly

     

    3.3 - script

    - add PVP Ladder statues

     

    3.4 - script

    - fix the missing body style not display correctly

     

    3.5 - script

    - add .fix_custom_sprite setting to fix your server having custom animation equipment

     

    3.6 - script

    - fix a missing sprite change from LOOK_ROBE

     

    if your server has custom animation sprite, remember to set .fix_custom_sprite to true

     

     

    Questions:

    when people ask to make modification to this script, it always comes down to these 2

     

    1. monthly/weekly reset

    ladder will reset monthly or weekly ... self explain

     

    2. "@dotaannounce" off

    hmm ... after talked to some people, they want the announcement set to global, but then some players want to see who are dead, and some players doesn't bother

    and I also saw this is a custom modification ... can be made into this script but ... nah ... I'll do it when I feel like it


  16. since someone ask, I also post my finding

    https://annieruru.blogspot.com/2019/01/how-to-install-plugin.html

     

    1. get generate-translations plugin to run

    plugins_list: [
    	/* Enable HPMHooking when plugins in use rely on Hooking */
    	"HPMHooking",
    	//"db2sql",
    	//"sample",
    	//"other",
    	//"mapcache",
    	"generate-translations",
    
    //	"aaa",
    	"zzz",
    //	"noitem",
    	"OnPCStatCalcEvent",
    	"OnPCUseSkillEvent",
    ]

    2. type "cmd"

    herc_mapcache_1_1.png

    3. type map-server.exe -- help

    herc_mapcache_1_2.png

    4. type map-server.exe --generate-translations

    generate-translations.png

    GOT THIS ERROR

    generate-translations_error.png

    @4144, I can get this method to run db2sql plugin without error, but this plugin throws error on me


  17. since there are people bumping this thread, and a lot of stuffs has changed since then, I decided to redo this again

     

    1st, stupid patch because of this commit

     src/common/mmo.h | 2 +-
     src/map/skill.c  | 1 +
     2 files changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/src/common/mmo.h b/src/common/mmo.h
    index e4b5a8bd5..6d029228a 100644
    --- a/src/common/mmo.h
    +++ b/src/common/mmo.h
    @@ -234,7 +234,7 @@
     #define MAX_CART 100
     #endif
     #ifndef MAX_SKILL_DB
    -#define MAX_SKILL_DB 1314 ///< Maximum number of skills in the skill DB (compacted array size)
    +#define MAX_SKILL_DB 1319 ///< Maximum number of skills in the skill DB (compacted array size)
     #endif
     #ifndef MAX_SKILL_ID
     #define MAX_SKILL_ID 10015   // [Ind/Hercules] max used skill ID
    diff --git a/src/map/skill.c b/src/map/skill.c
    index c2a336d7e..f827eb21f 100644
    --- a/src/map/skill.c
    +++ b/src/map/skill.c
    @@ -97,6 +97,7 @@ static const struct {
     	{ HLIF_HEAL, MH_VOLCANIC_ASH },
     	{ MS_BASH, MER_INVINCIBLEOFF2 },
     	{ EL_CIRCLE_OF_FIRE, EL_STONE_RAIN },
    +	{ 2991, 2995 },
     	{ GD_APPROVAL, GD_DEVELOPMENT },
     	CUSTOM_SKILL_RANGES
     };

    then .... as usual, using latest OnPCUseSkillEvent ver1.5 and dastgir's duplicate npc

    db/re/skill_db.conf

    {
    	Id: 2995
    	Name: "CREATE_PORTAL"
    	Description: "CREATE_PORTAL"
    	MaxLevel: 3
    	Range: 15
    	SkillType: {
    		Place: true
    	}
    	CoolDown: 10000
    	Event_Label: "qwer::Onpos"
    },

    data/luafiles514/lua files/skillinfoz/skillinfolist.lub

    	[SKID.CREATE_PORTAL] = {
    		"CREATE_PORTAL";		
    		SkillName = "Create Portal",
    		MaxLv = 3,
    		Type = "Quest",
    		SpAmount = { 0 },
    		bSeperateLv = true,
    		AttackRange = { 15 },
    	},

    data/luafiles514/lua files/skillinfoz/skillid.lub

    CREATE_PORTAL = 2995

    data/luafiles514/lua files/skillinfoz/skilldescript.lub

    	[SKID.CREATE_PORTAL] = {
    		"Warp to various towns",
    		"MAX Lv : 3 ",
    		"Lv 1: warp to prontera.",
    		"Lv 2: warp to payon.",
    		"Lv 3: warp to alberta.",
    	},

     

    npc script

    -	script	asdf	FAKE_NPC,2,2,{
    	dispbottom strnpcinfo(0);
    	end;
    OnTouch:
    	switch($@warplv) {
    	case 1: warp "prontera", 156,191; break;
    	case 2: warp "payon", 162,233; break;
    	case 3: warp "alberta", 192,147;
    	}
    	end;
    OnInit:
    	switch($@warplv) {
    	case 1: waitingroom "prontera", 0; break;
    	case 2: waitingroom "payon", 0; break;
    	case 3: waitingroom "alberta", 0;
    	}
    	end;
    }
    
    -	script	qwerty	FAKE_NPC,{
    Onpos:
    	if (@create_warp_npc_delay + 10 > gettimetick(2)) {
    		dispbottom "cooldown";
    		end;
    	}
    	@create_warp_npc_delay = gettimetick(2);
    	.@i = ++.counter;
    	$@warplv = @useskilllv;
    	duplicatenpc "asdf", "asdf#"+ .@i, strcharinfo(PC_MAP), @useskillx, @useskilly, DIR_SOUTH, 1_SHADOW_NPC, 2,2;
    	$@warplv = 0;
    	sleep 5000;
    //	duplicateremove "asdf#"+ .@i; // Dastgir needs to fix this
    	disablenpc "asdf#"+ .@i;
    	end;
    OnPCStatCalcEvent:	
    	skill CREATE_PORTAL, 3;
    	end;
    }

     

    hmmm ..... its kinda working in theory but dastgir's .... plugin is broken currently

     

    1. duplicateremove can cause server crash

    2. OnTouch doesn't seem to work ...

     

    I think someone needs to fix duplicatenpc plugin ....

    ..... meh lots of problem of this mod, not in the mood to do this so push this aside ...... for now

     

     

×
×
  • Create New...

Important Information

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