Jump to content
  • 0

WoE Point System


Linkin Park

Question


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

Hi,

I would like to request a script that will give a point to whoever has the castle on a specific time

Example:

I have set a 2hours WoE time (7pm to 9pm)

Whoever guild has the castle during 7:30pm scores 1point, at 8:00pm, scores another 1 point.. Every 30minutes until end of WoE (9pm)

Every break of the Emperium will also give the guild 1 point.

and there will be an NPC Ladder to show the Top 3 Guilds with most points..

I'm using Euphy's WoE Controller: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/npc/custom/woe_controller.txt

Thank you in advance to whoever will make this..

Edited by MikzDawson
Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

How to make this woe points for the guild who owns the castle at the end of WOE? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  67
  • Reputation:   2
  • Joined:  08/09/13
  • Last Seen:  

@Capuche hello sir? would you please check this post again, i'm kinda interested on having this kind of script but with more options like, if its possible if only the active castle will be registered during woe time? like we can have the rest of maps in the arrays but it wont count except the active one.

 

TIA

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  08/28/20
  • Last Seen:  

Hello, is that working script? and how to add woe points shop? thanks godblesss

Edited by Sikdope
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

I believe there's already a script similar to this one.. I just don't know where I saw it. Also, I would also like to have this script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

If the information on my post isn't enough or is lacking something you can ask me. Please help with this :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

bumps for my topic..

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Whoever guild has the castle during 7:30pm scores 1point, at 8:00pm, scores another 1 point.. Every 30minutes until end of WoE (9pm)

Every break of the Emperium will also give the guild 1 point.

and there will be an NPC Ladder to show the Top 3 Guilds with most points..

Like you asked. Every time a guild break the emp, gains 1 point. Every 30 min atfer woe start, the guild who owns the castle get 1 point.

You must load the table in your sql.

If your woe have just 1 castle, delete other castle map in OnInit.

In guild/agit_main.txt add

// Add one points in rank guild
// ----------------------------
   callfunc( "gpoints_woe", .@GID, 1 );
//-----------------------------

after

OnAgitBreak:
   set .@GID,getcharid(2);


/*
CREATE TABLE IF NOT EXISTS `guild_points` (
 `guild_id` int(11) unsigned NOT NULL default '0',
 `guild_name` varchar(255) NOT NULL DEFAULT 'NULL',
 `total_points` int(11) unsigned NOT NULL default '0',
 `woe_points` int(11) unsigned NOT NULL default '0',
 PRIMARY KEY  (`guild_id`)
) ENGINE=MyISAM;
*/

prontera,160,164,5    script    Guild Points    90,{

// Configurations
// --------------
   function displaypoints;
   .@guild_cID = getcharid(2);
   .@npc$ = "[^7600CC Guild Points ^000000]";
   .@GM = getgmlevel();

L_main:
// Unavailable during WOE
// ----------------------
   if( ( agitcheck() || agitcheck2() ) && !.@GM ) {
       mes .@npc$;
       mes "Hello,",
           "I'm busy there is a WOE now, can you come back later ?.";
       close;
   }

// Main menu
// ---------
   mes .@npc$;
   mes "Hello "+ ( .@GM ? "^FF0000[ GM ] "+ strcharinfo(0) +"^000000," : strcharinfo(0) +"," );
   mes " ";
   mes "What can I do for you ?";
   next;

   switch( select( "^777777~ Top 3 Guild^000000", "^777777~ Last WOE statistics^000000", ( !.@guild_cID ? "" : "^777777~ My Guild Points^000000" ), "^777777~ Leave^000000" ) ) {
       case 1:
       case 2:
           if( !displaypoints( ( @menu -1 ? 0 : 1 ), 1 ) ) {
               mes .@npc$;
               mes " ";
               mes "There is no result sorry.";
               emotion e_swt;
               next;
           }
           break;
       case 3:
           query_sql( "SELECT `total_points` FROM `guild_points` WHERE `guild_id` = '"+ .@guild_cID +"'", .@total_points );
           mes .@npc$;
           mes " ";
           mes "Your guild have "+ .@total_points +" total points.";
           next;
           break;
       case 4:
           mes .@npc$,
               " ",
               "Then Goodbye !";
               close;
   }
   goto L_main;


OnAgitStart:
   initnpctimer;
   .timetick = gettimetick(2) + 1500;    // display an announce every 1500 secs ~ 25 min
   query_sql( "UPDATE `guild_points` SET `woe_points` = '0'" );
   end;

// give points every 30 min
// ------------------------
OnTimer1799000:
   if( gettimetick(2) > .timetick ) {
       .timetick = gettimetick(2) + 1500;
       displaypoints( 0,0 );
   }
   for( .@i = 0; .@i < .size_c; .@i++ ) {
       .@owned_by = getcastledata( .castle$[ .@i ],1 );
       if( .@owned_by )
           callfunc( "gpoints_woe", .@owned_by, 1 );
   }
   initnpctimer;
   end;

OnAgitEnd:
   displaypoints( 0,0 );
   stopnpctimer;
   sleep 5000;
   displaypoints( 1,0 );
   end;


// Display guild point to all / self
// ---------------------------------
function displaypoints {
   if( getarg(0) )
       .@nb = query_sql( "SELECT `guild_name`, `total_points` FROM `guild_points` WHERE `total_points` > 0 ORDER BY `total_points` DESC LIMIT 10", .@guild_name$, .@points );
   else
       .@nb = query_sql( "SELECT `guild_name`, `woe_points` FROM `guild_points` WHERE `woe_points` > 0 ORDER BY `woe_points` DESC LIMIT 10", .@guild_name$, .@points );

   if( !.@nb ) return 0;

   announce ( getarg(0) ? "~~~~~ Guild POINTS ~~~~~" : "~~~~~ Woe POINTS ~~~~~" ), ( getarg(1) ? bc_self : bc_all );
   for( .@i = 0; .@i < .@nb; .@i++ )
       announce .@points[ .@i ] +" points : "+ .@guild_name$[ .@i ], ( getarg(1,0) ? bc_self : bc_all );
   return 1;
}


OnInit:
// Castle list - 1 point for each castle owned
// -------------------------------------------
   setarray .castle$, "aldeg_cas01",    "aldeg_cas02",    "aldeg_cas03",    "aldeg_cas04",    "aldeg_cas05",
                       "gefg_cas01",    "gefg_cas02",    "gefg_cas03",    "gefg_cas04",    "gefg_cas05",
                       "payg_cas01",    "payg_cas02",    "payg_cas03",    "payg_cas04",    "payg_cas05",
                       "prtg_cas01",    "prtg_cas02",    "prtg_cas03",    "prtg_cas04",    "prtg_cas05",
                       "nguild_alde",    "nguild_gef",    "nguild_pay",    "nguild_prt",
                       "schg_cas01",    "schg_cas02",    "schg_cas03",    "schg_cas04",    "schg_cas05",
                       "arug_cas01",    "arug_cas02",    "arug_cas03",    "arug_cas04",    "arug_cas05";

   .size_c = getarraysize( .castle$ );
   end;
}

// Update guild_points table
// -------------------------
function    script    gpoints_woe    {
   .@guild_id = getarg(0);

   if( !query_sql( "SELECT `guild_id` FROM `guild_points` WHERE `guild_id` = '"+ .@guild_id +"' ", .@guild_id ) )
       query_sql( "INSERT INTO `guild_points` (`guild_id`, `guild_name`, `total_points`, `woe_points`) VALUE ('"+ .@guild_id +"', '"+ getguildname( .@guild_id ) +"', '0', '0')" );

   .@value = getarg(1);
   query_sql( "UPDATE `guild_points` SET `total_points` = ( total_points + ("+ .@value +") ), `woe_points` = ( woe_points + ("+ .@value +") ) WHERE `guild_id` = '" + .@guild_id + "'" );
   return;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

This will only add points to the castle that is active on that day? I mean, it should not add points to those guild that owns a castle that is not active during the WoE on that day.

Example

Monday = Kriemhild and Fad

Guild A owns Hohen, the points will be added only to the guild that owns Kriemhild and Fad.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

This will only add points to the castle that is active on that day? I mean, it should not add points to those guild that owns a castle that is not active during the WoE on that day.

Example

Monday = Kriemhild and Fad

Guild A owns Hohen, the points will be added only to the guild that owns Kriemhild and Fad.

No you didn't specify this I will make an edit... wait

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

Thanks Capuche, I'll wait for the edit ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,155,181,5    script    Woe Points    100,{
   .@nb = query_sql( "select * from woe_point order by points desc limit 3", .@guild_id, .@points );
   if ( !.@nb ) {
       mes "no record yet";
       close;
   }
   for ( .@i = 0; .@i < .@nb; .@i++ )
       mes ( .@i +1 )+". "+ getguildname( .@guild_id[.@i] ) +" -> "+ .@points[.@i];
   close;
OnClock1930:
OnClock2000:
OnClock2030:
OnClock2100:
   for ( .@i = 0; .@i < 30; .@i++ ) {
       .@castle_guild_id = getcastledata( getvariableofnpc( .Castles$[.@i], "WOE_CONTROL" ), 1 );
       if ( getvariableofnpc( .Active[0], "WOE_CONTROL" ) & 1 << .@i && .@castle_guild_id )
           query_sql "insert into woe_point values ( "+ .@castle_guild_id +", 1 ) on duplicate key update points = points +1";
   }
   end;
OnBreakEmp: // put doevent under OnAgitBreak ...
   query_sql "insert into woe_point values ( "+ getcharid(2) +", 1 ) on duplicate key update points = points +1";
   end;
}

why make things so hard ?

EDIT: ops, forgot the SQL create

create table woe_point (
guild_id int(11) unsigned primary key,
points int(11)
) engine = myisam;


EDIT2 ... wait a moment, I change the layout

ok here, I think better use existing table because if the guild gets deleted,

the row will also be deleted from the source itself

alter table guild add column woe_points int(11) default 0 after emblem_data, add index (woe_points);

prontera,155,181,5    script    Woe Points    100,{
   .@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
   for ( .@i = 0; .@i < .@nb; .@i++ ) {
       if ( !.@points[.@i] ) break;
       mes ( .@i +1 )+". "+ .@guild_name$[.@i] +" -> "+ .@points[.@i];
   }
   close;
OnClock1930:
OnClock2000:
OnClock2030:
OnClock2100:
   for ( .@i = 0; .@i < 30; .@i++ ) {
       .@castle_guild_id = getcastledata( getvariableofnpc( .Castles$[.@i], "WOE_CONTROL" ), 1 );
       if ( getvariableofnpc( .Active[0], "WOE_CONTROL" ) & 1 << .@i && .@castle_guild_id )
           query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ .@castle_guild_id;
   }
   end;
OnBreakEmp: // put doevent under OnAgitBreak ...
   query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);
   end;
}

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

prontera,155,181,5	script	Woe Points	100,{
.@nb = query_sql( "select * from woe_point order by points desc limit 3", .@guild_id, .@points );
if ( !.@nb ) {
	mes "no record yet";
	close;
}
for ( .@i = 0; .@i < .@nb; .@i++ )
	mes ( .@i +1 )+". "+ getguildname( .@guild_id[.@i] ) +" -> "+ .@points[.@i];
close;
OnClock1930:
OnClock2000:
OnClock2030:
OnClock2100:
for ( .@i = 0; .@i < 30; .@i++ ) {
	.@castle_guild_id = getcastledata( getvariableofnpc( .Castles$[.@i], "WOE_CONTROL" ), 1 );
	if ( getvariableofnpc( .Active[0], "WOE_CONTROL" ) & 1 << .@i && .@castle_guild_id )
		query_sql "insert into woe_point values ( "+ .@castle_guild_id +", 1 ) on duplicate key update points = points +1";
}
end;
OnBreakEmp: // put doevent under OnAgitBreak ...
query_sql "insert into woe_point values ( "+ getcharid(2) +", 1 ) on duplicate key update points = points +1";
end;
}

why make things so hard ?

EDIT: ops, forgot the SQL create

create table woe_point (
guild_id int(11) unsigned primary key,
points int(11)
) engine = myisam;


EDIT2 ... wait a moment, I change the layout

ok here, I think better use existing table because if the guild gets deleted,

the row will also be deleted from the source itself

alter table guild add column woe_points int(11) default 0 after emblem_data, add index (woe_points);

prontera,155,181,5	script	Woe Points	100,{
.@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
for ( .@i = 0; .@i < .@nb; .@i++ ) {
	if ( !.@points[.@i] ) break;
	mes ( .@i +1 )+". "+ .@guild_name$[.@i] +" -> "+ .@points[.@i];
}
close;
OnClock1930:
OnClock2000:
OnClock2030:
OnClock2100:
for ( .@i = 0; .@i < 30; .@i++ ) {
	.@castle_guild_id = getcastledata( getvariableofnpc( .Castles$[.@i], "WOE_CONTROL" ), 1 );
	if ( getvariableofnpc( .Active[0], "WOE_CONTROL" ) & 1 << .@i && .@castle_guild_id )
		query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ .@castle_guild_id;
}
end;
OnBreakEmp: // put doevent under OnAgitBreak ...
query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);
end;
}

Hi Annie,

This will work even if on the same day there's 2 castles active on WoE?

Example:

Sunday (7-9pm) prtg_cas01 and prtg_cas02 are active..

then Monday to Friday I have 1 castle enabled which is Second Edition castle :)

Thank you for the script Annie <3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

		.@castle_guild_id = getcastledata( getvariableofnpc( .Castles$[.@i], "WOE_CONTROL" ), 1 );
	if ( getvariableofnpc( .Active[0], "WOE_CONTROL" ) & 1 << .@i && .@castle_guild_id )
		query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ .@castle_guild_id;

yes it will, can't read these 3 lines ?

in euphy's woe controller script, many variables are already preset there

I just have to use some getvariableofnpc retrieve the value directly from there

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

Thank you very much <3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

.@castle_guild_id = getcastledata( getvariableofnpc( .Castles$[.@i], "WOE_CONTROL" ), 1 );
		if ( getvariableofnpc( .Active[0], "WOE_CONTROL" ) & 1 << .@i && .@castle_guild_id )
			query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ .@castle_guild_id;
yes it will, can't read these 3 lines ?

in euphy's woe controller script, many variables are already preset there

I just have to use some getvariableofnpc retrieve the value directly from there

 

OnBreakEmp: // put doevent under OnAgitBreak ...
    query_sql "insert into woe_point values ( "+ getcharid(2) +", 1 ) on duplicate key update points = points +1";
    end;

 

where to add this one?

or will i just let this inside the script? sorry for a newbie question

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

bump

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

where to add this one?

or will i just let this inside the script? sorry for a newbie question

OnBreakEmp: // put doevent under OnAgitBreak ...
    query_sql "insert into woe_point values ( "+ getcharid(2) +", 1 ) on duplicate key update points = points +1";
    end;

Leave this alone in the script

 

 

In guild/agit_main.txt add after OnAgitBreak:

doevent "Woe Points::OnBreakEmp";
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

thanks sir^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

How can i make a shop for this script that will make WOE Points as the currency and it is a shop for the guild master only?


 

 

where to add this one?


or will i just let this inside the script? sorry for a newbie question

OnBreakEmp: // put doevent under OnAgitBreak ...
    query_sql "insert into woe_point values ( "+ getcharid(2) +", 1 ) on duplicate key update points = points +1";
    end;

Leave this alone in the script

 

 

In guild/agit_main.txt add after OnAgitBreak:

doevent "Woe Points::OnBreakEmp";

Bump

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

bump

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...