Jump to content

Emistry

Support Leaders
  • Content Count

    526
  • Joined

  • Days Won

    21

Posts posted by Emistry


  1. well, if we are to follow logical flow, the menu part shouldn't be reachable since it's empty. 

    Not sure why would official server would allow it if this happened in official server.

     

    by the way, the method of checking using this way isn't good in term of dynamic.

    if ( .@menu$ == "::::::::::" ) {

    because if users adjusted the loop size / array , the condition will be bypass again if they didnt update / add extra ":" into it.

     

    personally think that, hardcoded value shall be avoided as much as possible during npc execution.


  2. by default, you should show your full script.

     

    if you're referring to a blank menu, that mean your script didnt provide a checking for no equipments selection in the menu.

    for ( .@i = EQI_HEAD_TOP; .@i <= EQI_SHOES; .@i++ ) {	.@item_id = getequipid( .@i );	if ( .@item_id != -1 ) {		.@menu$ = .@menu$ + getitemname( .@item_id );		.@equip_count++;	}	.@menu$ = .@menu$ + ":";}if ( .@equip_count ) {	.@part = select( .@menu$ );}else {	mes "You didn't wear any equipments.";}

  3.         .@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.


  4. OnPCLoadMapEvent is better if you want to block it from woe since they can recall the guild member using skill which bypass the woe portal.

     

    @@Garr

    your script will caused error when loaded since no char is attached to call the strcharinfo() script command.

     

    beside it need loadevent mapflag to make it work.


  5. -	script	whisper	-1,{		OnWhisperGlobal:		.@aid = getcharid( 3,@whispervar0$ );		if ( !.@aid ) {			dispbottom "char not found.";		}		else if ( attachrid( .@aid ) ) {			mes "You have been murdered.";			close2;			unitkill .@aid;		}		end;}
    npc:whisper # player_name

  6. if you want ...

    • BLOCK_SKILL
    • BLOCK_COMMAND
    • BLOCK_DROP
    • BLOCK_ATCOMMAND
    • BLOCK_GSTORAGE
    • BLOCK_NOIDEAWHATELSETOPOSTHERE

    i just random post..O_O

     

    about this part

    +               unsigned int blockedattack :1;+               unsigned int blockedskill :1;+               unsigned int blockedchat :1;

    how about just make use only one variable and store all the enum value since it's bitmask ??

    with this, we can easily create another script command that get all the blocked state.

     

    Example :

    if ( getpcblock() & BLOCK_MOVE ) {    mes "your movement is still blocked.";}

  7. about Gerz method,

    just thinking how about make it into support bitmask ?

     *      1 = block move *      2 = block attack *      4 = block skill *      8 = block chat *     16 = immune attack

    we can block several state at once. With these you can update these states at once without need to call the script command for multiple times ?
     
    btw, can make us of const.txt to support constants usage for better readability.
    Example :

    BLOCK_MOVE | BLOCK_ATTACK | BLOCK_SKILL | BLOCK_CHAT

    Example Usage :

    // to enable blockpcblock 2000000, BLOCK_MOVE , true;pcblock 2000000, BLOCK_MOVE | BLOCK_ATTACK | BLOCK_SKILL , true;// to disable blockpcblock 2000000, BLOCK_MOVE , false;pcblock 2000000, BLOCK_MOVE | BLOCK_ATTACK | BLOCK_SKILL , false;

    then we can deprecate the pcblockmove


  8. that is why the item_db2, mob_db2, anything2 files are used for :P I don't really think that anyone ever changed everything in those files so that all of them are needed to act like that :P

     

    -1

    I know, but I also refer to those files like

    • quest_db.conf
    • produce_db.txt
    • sc_config.txt
    • map_index.txt
    • skill_db.txt
    • etc 

     

    when you got so many files to import , so it's better to just group them all together rather than having those "2" suffix.


  9. - script MOTD_HOURLY -1,{OnInit:	.@ServName$ = "YourRO";	setarray .announcements$,	"Hope you're having fun on "+ .@ServName$+"!",	"Please remember to review our "+ .@ServName$+", check the website for more information!",	"Remember, prolong periods of gameplay can cause serious health problems, take a breather! "+ .@ServName$+" can wait!",	"Type @commands to view a list of helpful tools to aid you in your adventure.",	"Don't forget to check the forums for the latest updates on "+ .@ServName$+"!",	"Remember, a GM will never ask for your username and password, always be safe.",	"Reminder, hackers, botters, exploiters will recieve a harsh punishment if caught. That is NOT tolerated here at "+ .@ServName$+".",	.@ServName$+" is very happy to have such a wonderful community!",	"Don't forget to Vote to gain Points!",	"Keep up the fun here at "+ .@ServName$+"!";	.announcements_size = getarraysize( .announcements$ );	.npc_name$ = strnpcinfo(0);	end;OnPCLoginEvent:	addtimer 3600000,.npc_name$+"::OnPCLoginEvent";	announce .announcements$[ rand( .announcements_size ) ],bc_self;end;}

     

    or

    -	script	MOTD_HOURLY	-1,{	OnPCLoginEvent:	addtimer 3600000,strnpcinfo(0)+"::OnPCLoginEvent";	.@ServName$ = "YourRO";	.@motd$ = F_Rand( 		"Hope you're having fun on "+ .@ServName$+"!",		"Please remember to review our  "+ .@ServName$+", check the website for more information!",		"Remember, prolong periods of gameplay can cause serious health problems, take a breather!  "+ .@ServName$+" can wait!",		"Type @commands to view a list of helpful tools to aid you in your adventure.",		"Don't forget to check the forums for the latest updates on  "+ .@ServName$+"!",		"Remember, a GM will never ask for your username and password, always be safe.",		"Reminder, hackers, botters, exploiters will recieve a harsh punishment if caught. That is NOT tolerated here at  "+ .@ServName$+".",		.@ServName$+" is very happy to have such a wonderful community!",		"Don't forget to Vote to gain Points!",		"Keep up the fun here at  "+ .@ServName$+"!"	);	announce .@motd$,bc_self;	end;}

  10. hmm ...
     

    initnpctimer("MOTD_HOURLY"),OnTimer3600000; 

    https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L6370
    Flag isn't refer to event/timer label.

    You actually need to use attachnpctimer.

    https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L6378

     

    OnTimer3600000:        @cid = getcharid(0);        @aid = getcharid(3);

    you can actually save these 2 variables when they login if you want to,   OnPCLoginEvent

    No need to keep execute the same thing over and over again.

     

    if( attachrid( @aid ) )    if( getcharid(0) == @cid ) 

    I believe there is no need to check for these.  just use the OnTimerQuit event label to keep track whether they already offline or not and stop the timer.

     


     

    You should try these methods ...

    • Array to store the announce messages.
    • use addtimer
    • avoid redundancy.
    • use Floating NPC.  (without valid location)

×
×
  • Create New...

Important Information

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