Jump to content

Cretino

Members
  • Posts

    50
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by Cretino

  1. 1 hour ago, ZelosAvalon said:

    if i am talking to an npc and during this dialogue the server is at night,

    and the npc's speech was: 
    Have a good day ~ 
    i would like to check it for him to say: 
    have a good night ~ instead of day

    Can anyone help me with this?

    best regards, ZelosAvalon

    You can use these script commands:

    Spoiler
    
    *isnight()
    *isday()
    
    These functions will return 1 or 0 depending on whether the server is in night
    mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
    the other way around. They can be used interchangeably, pick the one you like
    more:
    
        // These two are equivalent:
        if (isday()) mes "I only prowl in the night.";
        if (isnight() != 1) mes "I only prowl in the night.";

     

    And you need to configure your 'conf/battle/misc.conf' at this part:

    Spoiler
    
    // Choose if server begin with night (yes) or day (no)
    night_at_start: no
    
    // Define duration in msec of the day (default: 7200000 = 2 hours)
    // Set to 0 to disable day cycle (but not @day GM command).
    // Except 0, minimum is 60000 (1 minute)
    day_duration: 0
    
    // Define duration in msec of the night (default: 1800000 = 30 min)
    // Set to 0 to disable night cycle (but not @night GM command).
    // Except 0, minimum is 60000 (1 minute)
    night_duration: 0

     

     

    • Love 1
  2. 6 hours ago, erjsanmiguel said:

    Hi sir ! you mean from 

    
    set .chance, rand(100);

    to what ? sorry hehe ^_^

    Look the content in the spoiler in my first post here. There has a solution with an example how to use it...

    You'll need change the range of rand from '100' to '10000'.

    Rate (1 = 0.01%, 10 = 0.10%, 100 = 1.00%, 1000 = 10.00%, 10000 = 100.00%)

    And change the 'if' from:

    if (.chance >= 1 && .chance <= 5){

    To:

    if (rand(10000) < .chance){

    And change the value of variable '.chance' to the rate you want:

    From:

    set .chance, rand(100);

    To:

    set .chance, 500; // 500 = 5.00%
    
    • Upvote 1
  3. 46 minutes ago, erjsanmiguel said:

    Hi ! Is it possible to make my random box have a chance of lower than 1% ? like .5% chance to get a certain jackpot item ? ..

    I have this script I dont remember who gave this to me .. 


     

    
        setarray .i1[0],19824,40227,40239; // 1st Prize 5%
        set .i1random,rand(0,2); // Randomize Common Items; just change max amount if you add items
        set .chance, rand(100);
    
    	if (.chance >= 1 && .chance <= 5){
    		getitem .i1[.i1random],1;
    		announce "[Lucky Draw Machine]: ["+strcharinfo(0)+"] obtained 1x ["+getitemname(.i1[.i1random])+"] (5%).",0;
    		announce "[Lucky Draw Machine]: Try your luck and Win Special Prizes.",0;
    		specialeffect2 699;
    		end;

    As you can see this script gives you a chance of 1 to 5%  .. How can I make it a chance of lower than 1% ? thanks

    Yes, just change the 'range of rand' and you got it.

    Like this:

    Spoiler
    
    	setarray .i1[0],19824,40227,40239;	// 1st Prize 5%
    	set .i1random,rand(0,2);	// Randomize Common Items; just change max amount if you add items
    	// Rate (1 = 0.01%, 10 = 0.10%, 100 = 1.00%, 1000 = 10.00%, 10000 = 100.00%)
    	set .chance, 500; // 500 = 5.00%
    
    	if (rand(10000) < .chance)
    	{
    		getitem .i1[.i1random],1;
    		announce "[Lucky Draw Machine]: ["+strcharinfo(0)+"] obtained 1x ["+getitemname(.i1[.i1random])+"] (5%).",0;
    		announce "[Lucky Draw Machine]: Try your luck and Win Special Prizes.",0;
    		specialeffect2 699;
    		end;
    	}

     

     

  4. 58 minutes ago, Tzuridis said:

    I have this function:

     

    
    BUILDIN_FUNC(guildjoin) {
    int guild_id = script_getnum(st,2);
    TBL_PC *sd = NULL;
    struct guild * g;
    
    ----->    sd->guild_invite = guild_id;
        script_pushint( st, guild_reply_invite( sd, guild_id, 1 ) );
        return SCRIPT_CMD_SUCCESS;
    }

     

    Npc script just invokes:

    guildjoin 2

    With sd as null or 0 I get sd write access violation. I guess probably for any value.

    image.thumb.png.fbe7d7173939f2d0f3b608dc7c1e4b30.png

     

    If sd isn't null or not assigned any value, it states calling sd without it being initialized. Both cause the mapserver to crash/restart.
    I am not sure how it is not initialized with:
     

    
    TBL_PC *sd;
    
    or
      
    TBL_PC* sd

     

    sd is the cache the game uses right? My queries to the db are changing the value, is there a different way I can get the game to pull that data and overwrite what is in the cache?

    You're trying to use a pointer variable without initialization, this is why you're receiving this errors/crashes.

    Just uncommend the rest of script command and this error is fixed...

    Or let the script command like this:

    Spoiler
    
    // ADDED BY TED
    // guildjoin <guild id>,<char id>;
    BUILDIN_FUNC(guildjoin)
    {
    	int guild_id = script_getnum(st, 2);
    	TBL_PC *sd = NULL;
    	struct guild *g = NULL;
    
    	// Invalid char id.
    	if ((sd = map_charid2sd(script_getnum(st, 3))) == NULL)
    	{
    		script_pushint(st, 0);
    
    		return SCRIPT_CMD_FAILURE;
    	}
    
    	// The player is already in one guild.
    	if (sd->status.guild)
    	{
    		script_pushint(st, 0);
    
    		return SCRIPT_CMD_SUCCESS;
    	}
    
    	// Invalid guild id.
    	if ((g = guild_search(guild_id)) == NULL)
    	{
    		script_pushint(st, 0);
    
    		return SCRIPT_CMD_FAILURE;
    	}
    
    	// Guild is full.
    	if (g->max_member >= MAX_GUILD)
    	{
    		script_pushint(st, 0);
    
    		return SCRIPT_CMD_SUCCESS;
    	}
    
    	sd->guild_invite = guild_id;
    	sd->guild_invite_account = 0;
    
    	guild_reply_invite(sd, guild_id, 1);
    	script_pushint(st, 1);
    
    	return SCRIPT_CMD_SUCCESS;
    }

     

    And don't forget to change this to be like:

    Spoiler
    
    BUILDIN_DEF(guildjoin,"ii"),

     

    And the script command will work, don't forget to compile the emulator too.

  5. 1 hour ago, Zyper143 said:

    Need help to this error

    
    [Error]: buildin_countitem: Invalid item '32'.
    [Debug]: Source (NPC): Daily Quest at prontera (189,180)
    [Error]: buildin_countitem: Invalid item '42'.
    [Debug]: Source (NPC): Daily Quest at prontera (189,180)
    [Error]: buildin_countitem: Invalid item '33'.
    [Debug]: Source (NPC): Daily Quest at prontera (189,180)

    My script

    
    prontera,189,180,5	script	Daily Quest	533,{
    	if (getgmlevel() >= 80) goto GM_Menu;
    L_Start:
    	if (getgmlevel() >= 80) next;
    	mes "[ Daily  Quest ]";
    	mes "Total Daily Quests Finished: ^008800"+$DailyQuestTotal+"^000000.";
    	mes "Today Daily Quests Finished: ^0000FF"+$DailyQuestToday+"^000000.";
    	next;
    	mes "[Daily  Quest]";
    	mes "Hello "+strcharinfo(0)+"!";
    	mes "Do you want to start today's Quest?";
    	mes " ";
    	menu "Yes!",-,"Nahh",L_Close;
    	if(gettimetick(2) - CooldownQuest < (60 * 60 * 24)) {
    	next;
    	mes "[ Daily  Quest ]";
    	mes "^FF0000Sorry you have to wait 24 Hours until you can do the Quest again!^000000";
    	close;
    	}
    	next;
    	mes "[Daily Quest]";
    	mes "You'll need these item for Today's Quest:";
    	mes "^FF0000"+getitemname($QuestItem1)+"^000000 x "+$QuestItem1HM+"";
    	mes "^FF0000"+getitemname($QuestItem2)+"^000000 x "+$QuestItem2HM+"";
    	mes "^FF0000"+getitemname($QuestItem3)+"^000000 x "+$QuestItem3HM+"";
    	mes "In exchange you will get ^0000FF"+getitemname($DailyQuestPrize)+"^000000 x "+$DailyQuestPrizeHM+"";
    	next;
    	mes "[Daily Quest]";
    	mes "Do you have the items?";
    	menu "Yes! I do.",-,"Gimme some time.",L_Close;
    	if(countitem($QuestItem1) >= $QuestItem1HM) && (countitem($QuestItem2) >= $QuestItem2HM) && (countitem($QuestItem3) >= $QuestItem3HM) goto FinishQuest;
    	next;
    	mes "[Daily Quest]";
    	mes "You only have "+countitem($QuestItem1HM)+" of ^FF0000"+getitemname($QuestItem1)+"^000000, "+countitem($QuestItem2HM)+" of ^FF0000"+getitemname($QuestItem2)+"^000000, "+countitem($QuestItem3HM)+" of ^FF0000"+getitemname($QuestItem3)+"^000000.";
    	mes "Come back when you have it! Better get the items quickly. It's gonna change in a Day!";
    	close;
    
    L_Close:
    	next;
    	mes "[Daily Quest]";
    	mes "Come back again! Get the Items!";
    	mes "Goodbye!";
    	close;
    
    GM_Menu:
    	mes "[Daily Quest]";
    	mes "Hello GM "+strcharinfo(0)+"!";
    	mes "What can I do for you today?";
    	menu "Player Menu",L_Start,"Change Today's Quest/Prize",L_ChangeQuest,"Close",L_Close;
    
    L_ChangeQuest:
    	next;
    	mes "[Daily Quest]";
    	mes "What will you like to change?";
    	next;
    	menu "Go back.",GM_Menu,"Prize [^0000FF"+getitemname($DailyQuestPrize)+"^000000 x "+$DailyQuestPrizeHM+"]",L_ChangePrize,"Change Quest Randomly",L_ChangeQuestRandom,"Change Quest by Myself",L_ChangeQuestMyself;
    
    L_ChangeQuestMyself:
    	next;
    	mes "[Daily Quest]";
    	mes "Which item would you like to change first?";
    	menu "Go Back.",L_ChangeQuest,"Item 1 [^FF0000"+getitemname($QuestItem1)+"^000000 x "+$QuestItem1HM+"]",L_ChangeItem1,"Item 2 [^FF0000"+getitemname($QuestItem2)+"^000000 x "+$QuestItem2HM+"]",L_ChangeItem2,"Item 3 [^FF0000"+getitemname($QuestItem3)+"^000000 x "+$QuestItem3HM+"]",L_ChangeItem3;
    
    L_ChangeItem1:
    	next;
    	mes "[Daily Quest]";
    	mes "Alright. What will be the item?";
    	next;
    	input $QuestItem1;
    	next;
    	L_ChangeItem12:
    	mes "[Daily Quest]";
    	mes "How much of ^ff0000"+getitemname($QuestItem1)+"^000000 do you want?";
    	mes "It must be in the range of ^0088001 ~ 200^000000.";
    	next;
    	input $QuestItem1HM;
    	next;
    	if ($QuestItem1HM > 200) goto L_HMItem1Denied;
    	mes "[Daily Quest]";
    	mes "Item 1 Set.";
    	set $DailyQuestToday,0;
    	mes "^FF0000"+getitemname($QuestItem1)+"^000000 x "+$QuestItem1HM+".";
    	next;
    	goto L_ChangeQuest;
    
    L_HMItem1Denied:
    	mes "[Daily Quest]";
    	mes "This item (^ff0000"+getitemname($QuestItem1)+"^000000) must be in a range of ^0088001 ~ 200^000000.";
    	next;
    	goto L_ChangeItem12;
    
    L_ChangeItem2:
    	next;
    	mes "[Daily Quest]";
    	mes "Alright. What will be the item?";
    	next;
    	input $QuestItem2;
    	next;
    L_ChangeItem22:
    	mes "[Daily Quest]";
    	mes "How much of ^ff0000"+getitemname($QuestItem2)+"^000000 do you want?";
    	mes "It must be in the range of ^0088001 ~ 150^000000.";
    	next;
    	input $QuestItem2HM;
    	next;
    	if ($QuestItem2HM > 150) goto L_HMItem2Denied;
    	mes "[Daily Quest]";
    	mes "Item 2 Set.";
    	set $DailyQuestToday,0;
    	mes "^FF0000"+getitemname($QuestItem2)+"^000000 x "+$QuestItem2HM+".";
    	next;
    	goto L_ChangeQuest;
    
    L_HMItem2Denied:
    	mes "[Daily Quest]";
    	mes "This item (^ff0000"+getitemname($QuestItem2)+"^000000) must be in a range of ^0088001 ~ 150^000000.";
    	next;
    	goto L_ChangeItem22;
    
    L_ChangeItem3:
    	next;
    	mes "[Daily Quest]";
    	mes "Alright. What will be the item?";
    	next;
    	input $QuestItem3;
    	next;
    L_ChangeItem32:
    	mes "[Daily Quest]";
    	mes "How much of ^ff0000"+getitemname($QuestItem3)+"^000000 do you want?";
    	mes "It must be in the range of ^0088001 ~ 50^000000.";
    	next;
    	input $QuestItem3HM;
    	next;
    	if ($QuestItem3HM > 50) goto L_HMItem3Denied;
    	mes "[Daily Quest]";
    	mes "Item 3 Set.";
    	set $DailyQuestToday,0;
    	mes "^FF0000"+getitemname($QuestItem3)+"^000000 x "+$QuestItem3HM+".";
    	next;
    	goto L_ChangeQuest;
    
    L_HMItem3Denied:
    	mes "[Daily Quest]";
    	mes "This item (^ff0000"+getitemname($QuestItem3)+"^000000) must be in a range of ^0088001 ~ 50^000000.";
    	next;
    	goto L_ChangeItem32;
    
    L_ChangeQuestRandom:
    	set $QuestItem1, rand(701,1065);
    	set $QuestItem1HM, rand(1,200);
    	set $QuestItem2, rand(701,1065);
    	set $QuestItem2HM, rand(1,150);
    	set $QuestItem3, rand(701,1065);
    	set $QuestItem3HM, rand(1,50);
    	set $DailyQuestToday,0;
    	mes "[Daily Quest]";
    	mes "This is the Daily Quest:";
    	mes "^FF0000"+getitemname($QuestItem1)+"^000000 x "+$QuestItem1HM+"";
    	mes "^FF0000"+getitemname($QuestItem2)+"^000000 x "+$QuestItem2HM+"";
    	mes "^FF0000"+getitemname($QuestItem3)+"^000000 x "+$QuestItem3HM+"";
    	next;
    	goto GM_Menu;
    
    L_ChangePrize:
    	next;
    	mes "[Daily Quest]";
    	mes "Input the Prize";
    	next;
    	input $DailyQuestPrize;
    	next;
    	mes "[Daily Quest]";
    	mes "The Prize: "+getitemname($DailyQuestPrize)+" x How many?";
    	next;
    	input $DailyQuestPrizeHM;
    	next;
    	mes "[Daily Quest]";
    	mes "This is what you like?";
    	mes "^0000ff"+getitemname($DailyQuestPrize)+"^000000 x "+$DailyQuestPrizeHM+".";
    	menu "Yup, Thanks.",GM_Menu,"Noo! I made a mistake!",L_ChangePrize;
    
    FinishQuest:
    	next;
    	mes "[Daily Quest]";
    	mes "You got ^0000FF"+getitemname($DailyQuestPrize)+"^000000 x "+$DailyQuestPrizeHM+".";
    	delitem $QuestItem1,$QuestItem1HM;
    	delitem $QuestItem2,$QuestItem2HM;
    	delitem $QuestItem3,$QuestItem3HM;
    	getitem $DailyQuestPrize,$DailyQuestPrizeHM;
    	set CooldownQuest,gettimetick(2);
    	set $DailyQuestTotal,$DailyQuestTotal +1;
    	set $DailyQuestToday,$DailyQuestToday +1;
    	close;
    }
    
    -	script	DailyQuestItemChanger	-1,{
    OnInit:
    OnClock0000:
    	while ( getitemname( set( $QuestItem1, rand(701,1065) ) ) == "null" );
    	set $QuestItem1HM, rand(1,200);
    	while ( getitemname( set( $QuestItem2, rand(701,1065) ) ) == "null" );
    	set $QuestItem2HM, rand(1,150);
    	while ( getitemname( set( $QuestItem3, rand(701,1065) ) ) == "null" );
    	set $QuestItem3HM, rand(1,50);
    	set $DailyQuestToday,0;
    	end;
    }

     

    Here is the problem:

    Spoiler
    
    mes "You only have "+countitem($QuestItem1HM)+" of ^FF0000"+getitemname($QuestItem1)+"^000000, "+countitem($QuestItem2HM)+" of ^FF0000"+getitemname($QuestItem2)+"^000000, "+countitem($QuestItem3HM)+" of ^FF0000"+getitemname($QuestItem3)+"^000000.";

     

    The script command 'countitem' is receiving a invalid item id, because you're passing the wrong variable...

    '$QuestItem1HM' instead of '$QuestItem1', '$QuestItem2HM' instead of '$QuestItem2' and '$QuestItem3HM' instead of '$QuestItem3'.

    Just change to this and the error will probably stops:

    Spoiler
    
    mes "You only have "+countitem($QuestItem1)+" of ^FF0000"+getitemname($QuestItem1)+"^000000, "+countitem($QuestItem2)+" of ^FF0000"+getitemname($QuestItem2)+"^000000, "+countitem($QuestItem3)+" of ^FF0000"+getitemname($QuestItem3)+"^000000.";

     

     

    • Like 1
  6. 1 hour ago, Musika6988 said:

    Hi rAthena!

    Can I pls ask a little help with this script.

    I'm getting a "buildin_getitem: NonExistant item 0 requested"

    Thanks in advanced!

    Here is the problem:

    Spoiler
    
    	setarray .i1[0],7539,7621; // Common Items
    	set .i1rand,rand(0,2); // Randomize Common Items; just change max amount if you add items

     

    The array '.i1' size is '2', and the '.i1rand' randomize values from '0' to '2' instead of '0' to '1'... so when you trying to give the common items prize, when '.i1rand' get value the random value '2', the array '.i1[2]' has empty values because the array has declared values until 'i1[1]'.

    You can do this to fix:

    Spoiler
    
    set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items

     

    Or this:

    Spoiler
    
    	setarray .i1[0],7539,7621; // Common Items
    	set .i1rand,rand(getarraysize(.i1)); // Randomize Common Items; Don't need to change if you add more items. :)
    	setarray .i2[0],14003,13607,12922,12912; // Rare Items
    	set .i2rand,rand(getarraysize(.i2)); // Randomize Rare Items; Don't need to change if you add more items. :)
    	setarray .i3[0],19568,31120,31121; // Super Rare Items
    	set .i3rand,rand(getarraysize(.i3)); //Randomize Super Rare Items; Don't need to change if you add more items. :)
    	set .chance, rand(50);

     

     

    • Love 1
  7. On 2/18/2020 at 10:57 AM, Frost Diver said:

    Hi,

    I need some guide on how to warp a player after a period of times from a map? Eg: player farming zeny in a map. After 3 hours, he will be warped out to save points and there's a delay for 3 days before he can enter the map again. the delay is account bound.

    Any guides for this? Thanks for the assistances. I'm much appreciated

    I think is it:

    Spoiler
    
    -	script	Farm_Map_Config#1	FAKE_NPC,{
    	end;
    
    	OnInit:
    		// Name of the map using to farm.
    		.farm_map_name$ = "izlude";
    
    		// Delay time to enter in the map again. (Seconds)
    		.farm_map_delay = 259200;	// 259200 = 3 Days
    
    		// How much time the player can access the farm map. (Seconds)
    		.farm_map_time_access = 10800;	// 10800 = 3 Hours
    
    		// GameMaster level to avoid the delay and access time of farm map.
    		.farm_gm_avoid_lv = 99;
    
    		// ONLY CHANGE IF YOU KNOW WHAT YOU'RE DOING !!
    		setmapflag .farm_map_name$, MF_LOADEVENT;
    	end;
    
    	OnPCLogoutEvent:
    		if (getgroupid() >= .farm_gm_avoid_lv)
    		{
    			end;
    		}
    
    		if (strcharinfo(3) == .farm_map_name$)
    		{
    			if (#Farm_Map_Time > 0)
    			{
    				.@time_tick = gettimetick(2);
    
    				#Farm_Map_Time -= .@time_tick;
    
    				if (#Farm_Map_Time <= 0)
    				{
    					#Farm_Map_Time = 0;
    					#Farm_Map_Delay = .@time_tick + .farm_map_delay;
    				}
    
    				deltimer strnpcinfo(3) + "::OnTimeEnd";
    			}
    		}
    	end;
    
    	OnTimeEnd:
    		.@time_tick = gettimetick(2);
    		#Farm_Map_Time = 0;
    		#Farm_Map_Delay = .@time_tick + .farm_map_delay;
    
    		warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
    		dispbottom "Your " + callfunc("Time2Str", (.@time_tick + .farm_map_time_access)) + " of farm already end.";
    		dispbottom "You need to wait " + callfunc("Time2Str", #Farm_Map_Delay) + " to enter again in [" + .farm_map_name$ + "].";
    	end;
    
    	OnPCLoadMapEvent:
    		if (getgroupid() >= .farm_gm_avoid_lv)
    		{
    			end;
    		}
    
    		if (strcharinfo(3) == .farm_map_name$)
    		{
    			.@time_tick = gettimetick(2);
    
    			if (#Farm_Map_Time <= 0)
    			{
    				if (#Farm_Map_Delay <= 0 || (.@time_tick >= #Farm_Map_Delay && #Farm_Map_Delay > 0))
    				{
    					#Farm_Map_Time = .@time_tick + .farm_map_time_access;
    					#Farm_Map_Delay = 0;
    
    					dispbottom "You have " + callfunc("Time2Str", #Farm_Map_Time) + " to get farm in [" + .farm_map_name$ + "].";
    					addtimer ((#Farm_Map_Time - .@time_tick) * 1000), strnpcinfo(3) + "::OnTimeEnd";
    					end;
    				}
    				else
    				{
    					warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
    					dispbottom "You need to wait " + callfunc("Time2Str", #Farm_Map_Delay) + " to enter again in [" + .farm_map_name$ + "].";
    					end;
    				}
    			}
    			else
    			{
    				if (#Farm_Map_Time < .@time_tick)
    				{
    					#Farm_Map_Time += .@time_tick;
    					#Farm_Map_Delay = 0;
    
    					dispbottom "You have " + callfunc("Time2Str", #Farm_Map_Time) + " to get farm in [" + .farm_map_name$ + "].";
    					addtimer ((#Farm_Map_Time - .@time_tick) * 1000), strnpcinfo(3) + "::OnTimeEnd";
    					end;
    				}
    			}
    		}
    	end;
    }

     

    Tested and working.

    I hope it helps you. ?

  8. 3 hours ago, hardelite said:

    Mr. @Cretino,
    Script
    :
     

      Hide contents
    
    
    prontera,147,174,5	script	War of Treasure	4_TREASURE_BOX,{
    
    set @npc$,"[^008000War of Treasure^000000]";                                      
    
    	mes @npc$;
    	mes "Hello, "+strcharinfo(0)+"!";
    	mes	"Welcome to the portal of the War of Treasure event.";
    	mes "What do you want?";
    	switch(select("- Enter the event:- Info:- Ranking:Close"))
    	{
    		case 1:
    		next;
    		if(!getcharid(2)){
    		mes @npc$;
    		mes "Sorry, you must be a member of a clan to participate ...";
    		close;
    				}
    		if($woton == 0){
    		mes @npc$;
    		mes "The event is closed. Come back later...";
    		close;
    				}
    		warp "prt_are_in",97,25;end;
    
    		case 2:
    		next;
    		mes @npc$;
    		mes "The Treasury War will require a lot of bravery and companionship.";
    		next;
    		mes @npc$;
    		mes "The event takes place every day every 4 hours.";
    		next;
    		mes @npc$;
    		mes "After the event starts, your clan will need to survive 10 minutes of combat with other clans.";
    		next;
    		mes @npc$;
    		mes "If your clan manages to survive, 2 treasure chests will appear containing special prizes for those who destroy them.";
    		next;
    		mes @npc$;
    		mes	"And Poring Coins for other clan players who survive the event, which when accumulated can be exchanged for prizes.";
    		close;
    
    		case 3:
    		next;
    		mes "[Ranking WOT]";
    		query_sql "SELECT `name`, `baus` FROM `guild` WHERE '"+getcharid(2)+"' ORDER BY `Baus` DESC LIMIT 10",@nom$,@bau;
    		mes @np$;
    		mes "Position - ^228B22Guild^000000 - ^00B2EEChests^000000";
    		for (set .@i,0; .@i < 10; set .@i, .@i + 1)
    		mes (.@i+1)+"º^000000 - ^228B22"+@nom$[.@i]+"^000000 - ^00B2EE"+@bau[.@i]+"^000000";
    		close;
    		
    		case 4:
    		close;
    	}
    
    OnClock2125: callsub ComecarWot;
    OnClock0400: callsub ComecarWot;
    OnClock0800: callsub ComecarWot;
    OnClock1200: callsub ComecarWot;
    OnClock1600: callsub ComecarWot;
    OnClock2335: callsub ComecarWot;
    
    ComecarWot:
    		announce "[War of Treasure] It will start in 5 minutes.",8;
    		killmonsterall "prt_are_in";
    		removemapflag "prt_are_in",mf_noskill;
    		initnpctimer;
    		set $woton,1;
    		end;
    OnTimer60000:
    		Announce "[War of Treasure] It will start in 4 minutes.",8;
    		end;
    OnTimer120000:
    		Announce "[War of Treasure] It will start in 3 minutes.",8;
    		end;
    OnTimer180000:
    		Announce "[War of Treasure] It will start in 2 minutes.",8;
    		end;
    OnTimer240000:
    		Announce "[War of Treasure] It will start in 1 minutes.",8;
    		end;
    OnTimer300000:
    		gvgon "prt_are_in";
    		announce "[War of Treasure] Started!",8;
    		set $woton,0;
    		end;
    
    OnTimer900000:
    		stopnpctimer;
    		setmapflag "prt_are_in",mf_noskill;
    		gvgoff "prt_are_in";
    		if (getmapusers("prt_are_in") == 0 ){
    		end;
    				}
    		mapannounce "prt_are_in","There are 10 seconds left for the chests to appear.",8;
    		sleep 10000;
    		monster "prt_are_in",178,87,"Treasure's chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    		monster "prt_are_in",126,139,"Treasure's chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    
    OnMobDeath:
    	set .@account_id, getcharid(3);
    	set .@guild_id, getcharid(2);
    
    	deletearray .@guild_arr[0];
    	getguildmember .@guild_id, 2, .@guild_arr;
    
    	announce "[War of Treasure]: The player ["+strcharinfo(0)+"] of the clan ["+getguildname(.@guild_id)+"] destroyed one of the chests!",8;
    	getitem 7539, 100;	// Prize for those who destroy the chest.
    
    	for(.@i = 0; .@i < getarraysize(.@guild_arr); .@i++)
    	{
    		if (.@guild_arr[.@i] != .@account_id)
    		{
    			if (isloggedin(.@guild_arr[.@i]) == true)
    			{
    				if (attachrid(.@guild_arr[.@i]) == true)
    				{
    					if (strcharinfo(3) == "prt_are_in" && Hp > 0)
    					{
    						getitem 7539, 50;	// Award for the rest of the Guild.
    					}
    
    					detachrid;
    				}
    			}
    		}
    	}
    	end;
    }

     

    Would this error be because the script is trying to pull a ranking table?

    I tried unsuccessfully to add a ranking using the example of another script, in which case this would be: 

    https://nopaste.xyz/?4ce66c86678ee8e9#9uYl6pv+zIoW+neWMzZGGBvUhnGJDb1RlHu3qsqCHgw=

    But, due to the script pulling the 'login' and 'guild' table, this caused a lot of delay.

    I think it would be too complex for me to try to add a ranking.
    And maybe it would be better if I remove that ranking.

    I would no longer like to abuse your kindness, sir, but how to fix it?

    I really don't know why you need this rank, but you can do this:

    Spoiler
    
    prontera,147,174,5	script	War of Treasure	4_TREASURE_BOX,{
    	set .@npc$,"[^008000War of Treasure^000000]";
    	mes .@npc$;
    	mes "Hello, "+strcharinfo(0)+"!";
    	mes	"Welcome to the portal of the War of Treasure event.";
    	mes "What do you want?";
    	switch(select("- Enter the event:- Info:- Ranking:Close"))
    	{
    		case 1:
    		next;
    		if(!getcharid(2)){
    		mes .@npc$;
    		mes "Sorry, you must be a member of a clan to participate ...";
    		close;
    				}
    		if($woton == 0){
    		mes .@npc$;
    		mes "The event is closed. Come back later...";
    		close;
    				}
    		warp "prt_are_in",97,25;end;
    
    		case 2:
    		next;
    		mes .@npc$;
    		mes "The Treasury War will require a lot of bravery and companionship.";
    		next;
    		mes .@npc$;
    		mes "The event takes place every day every 4 hours.";
    		next;
    		mes .@npc$;
    		mes "After the event starts, your clan will need to survive 10 minutes of combat with other clans.";
    		next;
    		mes .@npc$;
    		mes "If your clan manages to survive, 2 treasure chests will appear containing special prizes for those who destroy them.";
    		next;
    		mes .@npc$;
    		mes	"And Poring Coins for other clan players who survive the event, which when accumulated can be exchanged for prizes.";
    		close;
    
    		case 3:
    		next;
    		mes "[Ranking WOT]";
    		query_sql "SELECT `name`, `baus` FROM `guild` WHERE '"+getcharid(2)+"' AND `baus` > '0' ORDER BY `baus` DESC LIMIT 10",.@nom$,.@bau;
    		mes "Position - ^228B22Guild^000000 - ^00B2EEChests^000000";
    		for (set .@i,0; .@i < getarraysize(.@nom$); set .@i, .@i + 1)
    		mes (.@i+1)+"º^000000 - ^228B22"+.@nom$[.@i]+"^000000 - ^00B2EE"+.@bau[.@i]+"^000000";
    		close;
    		
    		case 4:
    		close;
    	}
    
    OnClock2125: callsub ComecarWot;
    OnClock0400: callsub ComecarWot;
    OnClock0800: callsub ComecarWot;
    OnClock1200: callsub ComecarWot;
    OnClock1600: callsub ComecarWot;
    OnClock2335: callsub ComecarWot;
    
    ComecarWot:
    		announce "[War of Treasure] It will start in 5 minutes.",8;
    		killmonsterall "prt_are_in";
    		removemapflag "prt_are_in",mf_noskill;
    		initnpctimer;
    		set $woton,1;
    		end;
    OnTimer60000:
    		Announce "[War of Treasure] It will start in 4 minutes.",8;
    		end;
    OnTimer120000:
    		Announce "[War of Treasure] It will start in 3 minutes.",8;
    		end;
    OnTimer180000:
    		Announce "[War of Treasure] It will start in 2 minutes.",8;
    		end;
    OnTimer240000:
    		Announce "[War of Treasure] It will start in 1 minutes.",8;
    		end;
    OnTimer300000:
    		gvgon "prt_are_in";
    		announce "[War of Treasure] Started!",8;
    		set $woton,0;
    		end;
    
    OnTimer900000:
    		stopnpctimer;
    		setmapflag "prt_are_in",mf_noskill;
    		gvgoff "prt_are_in";
    		if (getmapusers("prt_are_in") == 0 ){
    		end;
    				}
    		mapannounce "prt_are_in","There are 10 seconds left for the chests to appear.",8;
    		sleep 10000;
    		monster "prt_are_in",178,87,"Treasure's chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    		monster "prt_are_in",126,139,"Treasure's chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    
    OnMobDeath:
    	// If not player attached end the script. (This can happen if kill the monster with atcommands or player not exists in map-server no more.)
    	if (playerattached() == false)
    	{
    		end;
    	}
    
    	set .@account_id, getcharid(3);
    	set .@guild_id, getcharid(2);
    
    	deletearray .@guild_arr[0];
    	getguildmember .@guild_id, 2, .@guild_arr;
    
    	announce "[War of Treasure]: The player ["+strcharinfo(0)+"] of the clan ["+getguildname(.@guild_id)+"] destroyed one of the chests!",8;
    	getitem 7539, 100;	// Prize for those who destroy the chest.
    
    	// Chest count only for who break.
    	query_sql "UPDATE `char` SET `baus` = `baus` + '1' WHERE `char_id`= '" + getcharid(0) + "'";
    
    	// Character points.
    	query_sql "UPDATE `login` SET `pontoswot` = `pontoswot` + '100' WHERE `account_id` = '" + getcharid(3) + "'";
    
    	// Guild chest count and points.
    	query_sql "UPDATE `guild` SET `baus` = `baus` + '1' WHERE `guild_id` = '" + .@guild_id + "'";
    	query_sql "UPDATE `guild` SET `pontosgwot` = `pontosgwot` + '50' WHERE `guild_id` = '" + .@guild_id + "'";
    
    	for(.@i = 0; .@i < getarraysize(.@guild_arr); .@i++)
    	{
    		if (.@guild_arr[.@i] != .@account_id)
    		{
    			if (isloggedin(.@guild_arr[.@i]) == true)
    			{
    				if (attachrid(.@guild_arr[.@i]) == true)
    				{
    					if (strcharinfo(3) == "prt_are_in" && Hp > 0)
    					{
    						getitem 7539, 50;	// Award for the rest of the Guild.
    
    						// Give 50 points to other guild players.
    						query_sql "UPDATE `login` SET `pontoswot` = `pontoswot` + '50' WHERE `account_id` = '" + getcharid(3) + "'";
    					}
    
    					detachrid;
    				}
    			}
    		}
    	}
    	end;
    }
    
    prontera,154,196,5	script	Ranking WOT	837,{
    	mes "[Ranking WOT]";
    	mes "Olá "+strcharinfo(0)+" qual ranking da wot deseja visualizar?";
    
    	switch(select("- Ranking Jogadores:- Ranking Clãs"))
    	{
    		case 1:
    			next;
    			mes "[Ranking WOT]";
    			query_sql "SELECT `name`, `baus` FROM `char` WHERE '"+getcharid(0)+"' AND `baus` > '0' ORDER BY `baus` DESC LIMIT 10",.@nome$,.@baus;
    			mes "Posição - ^228B22Nome^000000 - ^00B2EEBaus^000000";
    	
    			for (set .@i,0; .@i < getarraysize(.@nome$); set .@i, .@i + 1)
    				mes (.@i+1)+"º^000000 - ^228B22"+.@nome$[.@i]+"^000000 - ^00B2EE"+.@baus[.@i]+"^000000";
    		break;
    
    		case 2:
    			next;
    			mes "[Ranking WOT]";
    			query_sql "SELECT `name`, `baus` FROM `guild` WHERE '"+getcharid(2)+"' AND `baus` > '0' ORDER BY `baus` DESC LIMIT 10",.@nom$,.@bau;
    			mes "Posição - ^228B22Clã^000000 - ^00B2EEBaus^000000";
    
    			for (set .@i,0; .@i < getarraysize(.@nom$); set .@i, .@i + 1)
    				mes (.@i+1)+"º^000000 - ^228B22"+.@nom$[.@i]+"^000000 - ^00B2EE"+.@bau[.@i]+"^000000";
    		break;
    	}
    
    	close;
    }

     

    To solve the 'delay' problem getting the rank information you'll need create one table and make the changes in the script to 'save' and 'load' the 'points' there, so when you access the new table not will have so many 'characters' or 'guilds' to 'search'. I made some changes, but I think your 'delay' problem not will change.

    I hope it's help you. ?

     

    • Love 1
  9. 51 minutes ago, hardelite said:

    Thank you Master @Cretino
    It works perfectly.

    Just a question about the warning on the map-server.

    Is this warning normal?

    Sem-t-tulo.png

    No, this one is because you trying to use the command 'getcharid(3)' without rid attached.

    What you are trying to do?
    Show the full script.

  10. 24 minutes ago, hardelite said:

    Hello community friends, how are you ?a

    Please, I wish someone could help me with the prize for this event.
    Due to the event's award being in points loaded directly into the 'login' and 'guild' tables this generates a huge delay on my server.

    The award works as follows:
    Whoever destroys the monsters will receive 100 cashpoints and 100 wotpoints. And the rest of the clan players who manage to survive the event will receive 50 wotpoints.

    And I would like to change it. But I have no idea how I do it.

    Is it possible, instead of adding points, to add item? for example:
    Whoever destroys the mafia will win 100 PoringCoin (7539)
    And the rest of the clan that survives on the map will win 50 PoringCoin?

    Script:

      Hide contents
    
    
    	monster "prt_are_in",178,87,"Treasure chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    	monster "prt_are_in",126,139,"Treasure chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    	stopnpctimer;
    
    	OnMobDeath:
    	set .@GID,getcharid(0);
    	set .@NAME,getcharid(2);
    	set .@ACC,getcharid(3);
    	
    	query_sql "UPDATE `char` SET `baus` = `baus` +1 WHERE `char_id`="+.@GID+"";
    	query_sql "UPDATE `login` SET `wotpoints` = `wotpoints` +100 WHERE `account_id`="+.@ACC+"";
    	announce "[Wot] The player ["+strcharinfo(0)+"] of the clan ["+getguildName(.@NAME)+"] just destroyed one of the chests!",8;
    	atcommand "@cash 100";
    
    	set .@GUILD,getcharid(2);
    	query_sql "UPDATE `guild` SET `baus` = `baus` +1 WHERE `guild_id`="+.@GUILD+"";
    	query_sql "UPDATE `guild` SET `pontosgwot` = `pontosgwot` +50 WHERE `guild_id`="+.@GUILD+"";
    	end;
    }

     

    Honestly, thank you very much!

    Hey, I think is it:

    Spoiler
    
    	monster "prt_are_in",178,87,"Treasure chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    	monster "prt_are_in",126,139,"Treasure chest",1324,1,strnpcinfo(0)+"::OnMobDeath";
    	stopnpctimer;
    
    	OnMobDeath:
    	/*
    	set .@GID,getcharid(0);
    	set .@NAME,getcharid(2);
    	set .@ACC,getcharid(3);
    
    	query_sql "UPDATE `char` SET `baus` = `baus` +1 WHERE `char_id`="+.@GID+"";
    	query_sql "UPDATE `login` SET `wotpoints` = `wotpoints` +100 WHERE `account_id`="+.@ACC+"";
    	announce "[Wot] The player ["+strcharinfo(0)+"] of the clan ["+getguildName(.@NAME)+"] just destroyed one of the chests!",8;
    	atcommand "@cash 100";
    
    	set .@GUILD,getcharid(2);
    	query_sql "UPDATE `guild` SET `baus` = `baus` +1 WHERE `guild_id`="+.@GUILD+"";
    	query_sql "UPDATE `guild` SET `pontosgwot` = `pontosgwot` +50 WHERE `guild_id`="+.@GUILD+"";
    	end;
    	*/
    
    	set .@account_id, getcharid(3);
    	set .@guild_id, getcharid(2);
    
    	deletearray .@guild_arr[0];
    	getguildmember .@guild_id, 2, .@guild_arr;
    
    	announce "[Wot] The player ["+strcharinfo(0)+"] of the clan ["+getguildname(.@guild_id)+"] just destroyed one of the chests!",8;
    	getitem 7539, 100;
    
    	for(.@i = 0; .@i < getarraysize(.@guild_arr); .@i++)
    	{
    		if (.@guild_arr[.@i] != .@account_id)
    		{
    			if (isloggedin(.@guild_arr[.@i]) == true)
    			{
    				if (attachrid(.@guild_arr[.@i]) == true)
    				{
    					if (strcharinfo(3) == "prt_are_in" && Hp > 0)
    					{
    						getitem 7539, 50;
    					}
    
    					detachrid;
    				}
    			}
    		}
    	}
    
    	end;
    }

     

    • Love 1
  11. 3 hours ago, bu3nox said:

    Boa noite,

    Encontraram um bug no meu servidor que dava para farmar zeny muito fácil..

    Como faço para zerar o zeny de todas as contas do meu servidor?

    Obrigado!

    Você pode executas essas queries no seu banco de dados:

    Lembre-se: Executar essas queries com o servidor desligado!!

    Spoiler
    
    -- rAthena & Hercules
    UPDATE `char` SET `zeny` = '0';
    UPDATE `mail` SET `zeny` = '0';
    DELETE FROM `acc_reg_num` WHERE LOWER(`key`) LIKE '%bank%';
    -- Somente Hercules
    UPDATE `rodex_mail` SET `zeny` = '0';
    UPDATE `account_data` SET `bank_vault` = '0';

     

    Elas irão zerar todo o zeny de todos os personagens e qualquer quantia que tenha nos 'e-mails (RoDex)' e caso use algum tipo de 'banqueiro' que se encontra no emulador, será apagado todas as variáveis que armazenam o zeny. (Se seu emulador for rAthena execute somente as 3 primeiras queries, se for Hercules só copiar tudo e executar no banco de dados)

    Espero ter ajudado. ?

    • Upvote 1
  12. 6 hours ago, HaARiZz said:

    Hi all,

    I need help with problem that I facing as per screen shot below.

    image.png.d3aad76a41530b4bfafcc9e57bd4a189.png

    I can't trace the problem that trigger this warning.

    image.png.9b0868c7b0ca1c6779eadb7bd8594763.png

    Hope that somebody can help me to solve this problem.
    #P/S: I'm so sorry if I write this thread on the wrong section.

    Open your 'db\castle_db.txt' and search for these values:

    Spoiler
    
    // WOE TE castle
    34,te_aldecas1,Kafragarten 1,Manager_TE#Glaris
    35,te_aldecas2,Kafragarten 2,Manager_TE#Defolty
    36,te_aldecas3,Kafragarten 3,Manager_TE#Sorin
    37,te_aldecas4,Kafragarten 4,Manager_TE#Bennit
    38,te_aldecas5,Kafragarten 5,Manager_TE#W
    39,te_prtcas01,Gloria 1,Manager_TE#Gaebolg
    40,te_prtcas02,Gloria 2,Manager_TE#Richard
    41,te_prtcas03,Gloria 3,Manager_TE#Wigner
    42,te_prtcas04,Gloria 4,Manager_TE#Heine
    43,te_prtcas05,Gloria 5,Manager_TE#Nerious

     

    If don't have, this is the problem. xD

    This error occurs because the function 'getcastledata' can't found the guild castle information located in 'db\castle_db.txt'.

    • Upvote 1
  13. 1 hour ago, Suigetsu said:

    Good night masters!
    Could someone please help me with a script?

    I need all players on the prt_are_in map to be teleported to prontera once the last TREASURE_BOX is destroyed.

    Script:

      Reveal hidden contents
    
    
    OnClock2130: callsub ComecarWot;
    
    ComecarWot:
    		announce "[Treasure War] It will start in 5 minutes.",8;
    		killmonsterall "prt_are_in";
    		removemapflag "prt_are_in",mf_noskill;
    		initnpctimer;
    		set $woton,1;
    		end;
    OnTimer60000:
    		announce "[Treasure War] It will start in 4 minutes.",8;
    		end;
    OnTimer120000:
    		announce "[Treasure War] It will start in 3 minutes.",8;
    		end;
    OnTimer180000:
    		announce "[Treasure War] It will start in 2 minutes.",8;
    		end;
    OnTimer240000:
    		announce "[Treasure War] It will start in 1 minutes.",8;
    		end;
    
    OnTimer300000:
    		gvgon "prt_are_in";
    		announce "[Treasure War] Started!",8;
    		set $woton,0;
    		end;
    
    OnTimer900000:
    		stopnpctimer;
    		setmapflag "prt_are_in",mf_noskill;
    		gvgoff "prt_are_in";
    		if (getmapusers("prt_are_in") == 0 ){
    		end;
    				}
    		mapannounce "prt_are_in","There are 10 seconds left for the chests to appear.",8;
    		sleep 10000;
    		monster "prt_are_in",178,87,"Treasure's box",1324,1,strnpcinfo(0)+"::OnThisMobDeath";
    		monster "prt_are_in",126,139,"Treasure's box",1324,1,strnpcinfo(0)+"::OnThisMobDeath";
    
    OnThisMobDeath:
    		set @GID,getcharid(2);
    		set .@ACC,getcharid(3);
    		query_sql "UPDATE `login` SET `pontoswot` = `pontoswot` +100 WHERE `account_id`="+.@ACC+"";
    		announce "[Treasure War] The player ["+strcharinfo(0)+"] of the clan ["+getguildname(@GID)+"] just destroyed one of the chests!",8;
    		atcommand "@cash 100";
    		set .@GUILD,getcharid(2);
    		query_sql "UPDATE `guild` SET `baus` = `baus` +1 WHERE `guild_id`="+.@GUILD+"";
    		query_sql "UPDATE `guild` SET `pontosgwot` = `pontosgwot` +50 WHERE `guild_id`="+.@GUILD+"";
    		end;
    				}

     

    Sincerely, thank you very much.

    I think is it:

    Spoiler
    
    OnClock2130: callsub ComecarWot;
    
    ComecarWot:
    		announce "[Treasure War] It will start in 5 minutes.",8;
    		killmonsterall "prt_are_in";
    		removemapflag "prt_are_in",mf_noskill;
    		initnpctimer;
    		set $woton,1;
    		end;
    OnTimer60000:
    		announce "[Treasure War] It will start in 4 minutes.",8;
    		end;
    OnTimer120000:
    		announce "[Treasure War] It will start in 3 minutes.",8;
    		end;
    OnTimer180000:
    		announce "[Treasure War] It will start in 2 minutes.",8;
    		end;
    OnTimer240000:
    		announce "[Treasure War] It will start in 1 minutes.",8;
    		end;
    
    OnTimer300000:
    		gvgon "prt_are_in";
    		announce "[Treasure War] Started!",8;
    		set $woton,0;
    		end;
    
    OnTimer900000:
    		stopnpctimer;
    		setmapflag "prt_are_in",mf_noskill;
    		gvgoff "prt_are_in";
    		if (getmapusers("prt_are_in") == 0 ){
    		end;
    				}
    		mapannounce "prt_are_in","There are 10 seconds left for the chests to appear.",8;
    		sleep 10000;
    		set .mob_count, 2;
    		monster "prt_are_in",178,87,"Treasure's box",1324,1,strnpcinfo(0)+"::OnThisMobDeath";
    		monster "prt_are_in",126,139,"Treasure's box",1324,1,strnpcinfo(0)+"::OnThisMobDeath";
    
    OnThisMobDeath:
    		set @GID,getcharid(2);
    		set .@ACC,getcharid(3);
    		set .mob_count, .mob_count - 1;
    		query_sql "UPDATE `login` SET `pontoswot` = `pontoswot` +100 WHERE `account_id`="+.@ACC+"";
    		announce "[Treasure War] The player ["+strcharinfo(0)+"] of the clan ["+getguildname(@GID)+"] just destroyed one of the chests!",8;
    		atcommand "@cash 100";
    		set .@GUILD,getcharid(2);
    		query_sql "UPDATE `guild` SET `baus` = `baus` +1 WHERE `guild_id`="+.@GUILD+"";
    		query_sql "UPDATE `guild` SET `pontosgwot` = `pontosgwot` +50 WHERE `guild_id`="+.@GUILD+"";
    		if (.mob_count <= 0)
    		{
    			mapwarp "prt_are_in", "prontera", 156, 191;
    		}
    		end;
    				}

     

     

    • Like 1
  14. 16 minutes ago, Bringer said:

    can add option for Ranking System and Points and % to make it

    Sorry, but I don't want, you can search in 'doc\script_commands.txt' and 'src\map\' to understand how it works and make it yourself.

    Probably you'll need make some source modification.

  15. Hey guys, how are you doing?

    I've seen some scripts similar, but nothing like this.

    This is my version of this event, 'Crack The Code'.

    Description:

    Spoiler
    
    The NPC spawn in a random map and you need to find it and crack the code showing in the waiting room,
    to crack the code you need to digit the password of waiting room, (Need source modification to waiting room have password with NPCs.)
    if the player crack the password, he will win the prizes.

     

    Video showing how the script works:

    Crack The Code V1.1

    Some changes were made after this video.

    Features:

    Spoiler

    Configurations in script:

    Spoiler
    
    
     - GameMaster access level to configure and/or start/stop the event.
     - Show the right waiting room password in chat for testing purposes.
     - Set default values: When you erase some configuration and the map-server reload the default values configured are set.
     - Auto start event time.
     - Option to choose a 'Default Setup' (Configured inside the script.)
       or 'Personalized Setup' (Configured in-game.) when start the event manually.
       (Auto start events uses 'Personalized Setup' only.)
     - Option to not repeat the latest event map used. (Only work if have more than one map.
       The latest map will be reset if the event be forced to stop.)

     

    Configurations in-game:

    Spoiler
    
    
     - Set how many winners can have in one execution.
     - If set more than one winner, can set if can have the same winner in the same execution.
     - Set the size of waiting room password. (Minimum: 3, Maximum: 8)
     - Maps for start the event. (Add maps, remove and modify.)
     - Prizes for the event. (Add items, remove and modify. Items and amount.)
     - How many prizes one winner can have. (If not set all prizes, the player receive the quantity of random prizes.)
     - Event duration. (Values in milliseconds, Minimum time = '60 seconds' = '60 * 1000')

     

    Other things:

    Spoiler
    
    
     - To configure and/or start the event, use the command '@ctc'.
    
     - The auto start event can't be init when is configuring the script.
    
     - The event can't be configured when the same is already start.
    
     - GameMasters can start and stop the event when they want.
    
     - When map-server reload, the event is stopped if is execution.
    
     - Players can participate the event using the command '@ctc'
       to go to the event map (Random coordinates.) when the event start. (If the player is already in the map,
       he can't move again to the event map using the command.)
    
     - The latest map of player is saved when using the command '@ctc'
       to send him back when event end or if event only accept one winner per execution.
    
     - If the player entered in the event using the command '@ctc' and logout before the end,
       he will moved to the latest map.
    
     - The event have 10 minutes to be completed. (When reaches 5 minutes,
       the NPC send a announce showing ONE coordinate to find it,
       like (X: 145, Y: ???) or (X: ???, Y: 187))
    
     - When one player win the event, if configured to have more than one winner,
       the NPC generates a new waiting room password and move to other place in the same map.
    
     - The NPC announces the winner and show the latest right code used to enter in the waiting room.
    
     - If configured to not have the same winner and one player who already won
       and try to crack the code again in the same execution,
       the NPC will announce can't participate again
       and he can't move again to the event map using the command '@ctc'.
    
     - The password generated by the NPC are random using a code table configured in the script.
    
     - The code shown in the waiting room is shuffed.
       (Depending of the size of the password, the shuffed code can be equal of the right code.)
    
     - The event only start if all configurations is right. (Maps, prizes, code size and how many winners.)

     

     

     

    I have one 'limited' version what I want to share with you guys.

    crack_the_code_v1.0_rathena.txt

    Limitations of this version:

    Spoiler
    
     - Can have only one winner.
     - The waiting room has no password.
     - You can configure only one prize to winner.
     - The event can't start automatically. (Only GameMasters can start the event using the command '@ctc')
     - Need reload the script always you change some configuration. (Maps, prize and amount, size of password)
     - To crack the code, players need enter in the waiting room and digit the code in the chat.
     - Has a limit of players who can enter in the waiting room.
     - Players can't move to the map event using the command '@ctc'.
     - Has no security in the script to start the event if any configuration is wrong.

     

    I'm accepting suggestions. (I'll not make changes in limited version)

    Sorry for my english and thank you for the attention. ?

    I hope you guys like.

    Special thanks to @Radian, for helping me with feedback and support me. ?

    • Upvote 2
    • Love 2
  16. 1 hour ago, bu3nox said:

    Boa noite,

    Vou testar e já edito!

    @edit

    Ficou assim

    
    	Id:34093
    	AegisName: "Item_FinalRAG_1093"
    	Name: "Item FinalRAG 1093"
    	Type: 5
    	Buy: 0
    	Loc: 1
    	Slots: 4
    	View: 6093
    	Script: <"
    		bonus2 bAddRace,RC_DemiHuman,35;
    		bonus2 bSubEle,Ele_Earth,10;
    		bonus2 bSubEle,Ele_Wind,10;
    		bonus2 bSkillAtk,136,15;
    		bonus2 bSkillAtk,137,15;
    		bonus bStr,65;
    		bonus bDex,50;
    		bonus bAgi,35;
    		bonus bLuk,20;
    		{ sc_start SC_SPIRIT, INFINITE_TICK, 457; skilleffect 457,0; },{ sc_end SC_SPIRIT; }
    	">
    },
    {

    Porém, ele não concede a skill quando equipa, fiz algo de errado?

    Não funcionou por que você não fez da maneira correta...

    Eu postei no formato para usar no emulador do rAthena... e você tá usando Hercules...

    Também esqueci de colocar um detalhe mas isso não muda muita coisa.

    Você tem que falar essas coisas antes de pedir ajuda... se não fica complicado os emuladores são um pouco diferentes...

    Tenta assim:

    Spoiler
    
    {
    	Id:34093
    	AegisName: "Item_FinalRAG_1093"
    	Name: "Item FinalRAG 1093"
    	Type: 5
    	Buy: 0
    	Loc: 1
    	Slots: 4
    	View: 6093
    	Script: <"
    		bonus2 bAddRace,RC_DemiHuman,35;
    		bonus2 bSubEle,Ele_Earth,10;
    		bonus2 bSubEle,Ele_Wind,10;
    		bonus2 bSkillAtk,136,15;
    		bonus2 bSkillAtk,137,15;
    		bonus bStr,65;
    		bonus bDex,50;
    		bonus bAgi,35;
    		bonus bLuk,20;
    	">
    	OnEquipScript: <"
    		sc_start4(SC_SOULLINK, -1, 0, SL_ASSASIN, 0, 0);
    		skilleffect(SL_ASSASIN, 0);
    	">
    	OnUnequipScript: <"
    		sc_end(SC_SOULLINK);
    	">
    },

     

    Dessa vez eu testei e está funcionando.

    Lembrando que esse soul link está só configurado para mercenários se você deseja colocar para outra classe, você vai ter que procurar para entender como funciona.

    • Love 1
  17. Just read the file....

    Spoiler

    // Structure of Database:
    // Type,Stats per level,Random bonus start level,Random bonus value,Chance+1:Bonus+1,Chance+2:Bonus+2,Chance+3:Bonus+3,...

    // Type:
    //    0 - Armors
    //    1 - Level 1 weapons
    //    2 - Level 2 weapons
    //    3 - Level 3 weapons
    //    4 - Level 4 weapons

    // Chance:
    // 100 = 100%

    Example using Type 'Armors'.

    Original rate:

    Spoiler

    0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,10:300,10:300,10:400,10:400,10:400,10:400,10:500,10:500,10:500,10:500

    Modified to 75% all refine levels of 'Armors':

    Spoiler

    0,0,0,0,75:100,75:100,75:100,75:100,75:200,75:200,75:200,75:200,75:300,75:300,75:300,75:300,75:400,75:400,75:400,75:400,75:500,75:500,75:500,75:500

    Now just follow the example and modify to values you want for other types.

    • MVP 1
×
×
  • Create New...