Jump to content
  • 0

Capture the Flag : WoE Script


Xhiro

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

I wanted to create a new WoE script that is played like the following (I couldnt find it or i just fail at searching) =/

- Played like Capture the Flag

-There will be more then 1 emperium room (e.g. 3-5 emperiums in seperate rooms)

-The WoE will last for 1 hour, during WoE time, the castle does not change hands everytime the emperium is broken but instead only changes at the end of WoE hour.

-The winner will be based on who has the most emperiums at the end of the woe period

-If a draw between a guild and the castle owner happens, the current owner retains the castle

-If a draw between a guild another guild happens, ??? <--- Haven't thought about it

Since it isnt very fair for the current guild owner, the guild owner will get the following privileges

-The guild gets a special NPC that warps the current castle owner guild members ONLY

-The guild leader/members get access to a special monitor room that contains NPC which will allow them to know who are the current holders for all the emperiums and maybe a warp to get near to the emperiums?

I think its pretty complicated but I would really like it if anyone is able to script this for me. If you require more information do ask, I'll try to elaborate more.

Thank you in advance.

Edited by Xhiro
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


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

I finished this script in less than 10 minutes, but took me over 3 hours to write out battle.c, so noob me

sql-files

REPLACE INTO `mob_db2` VALUES (2901,'EMPERIUM_1','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2902,'EMPERIUM_2','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2903,'EMPERIUM_3','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2904,'EMPERIUM_4','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2905,'EMPERIUM_5','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

db\mob_avail.txt

2901, 1288
2902, 1288
2903, 1288
2904, 1288
2905, 1288

diff

Index: battle.c
===================================================================
--- battle.c	(revision 16821)
+++ battle.c	(working copy)
@@ -5021,6 +5021,24 @@
 if( (s_bl = battle_get_master(src)) == NULL )
	 s_bl = src;

+	if ( s_bl->type == BL_PC && t_bl->type == BL_MOB ) {
+		struct map_session_data *sd = BL_CAST( BL_PC, s_bl );
+		struct mob_data *md = BL_CAST( BL_MOB, t_bl );
+		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) ) {
+			if ( md->class_ >= 2901 && md->class_ <= 2905 && battle_getcurrentskill(src) > 0 )
+				return 0;
+			if (
+			md->class_ == 2901 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_1" ) ) ||
+			md->class_ == 2902 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_2" ) ) ||
+			md->class_ == 2903 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_3" ) ) ||
+			md->class_ == 2904 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_4" ) ) ||
+			md->class_ == 2905 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_5" ) )
+			) {
+				return 0;
+			}
+		}
+	}
+
 if ( s_bl->type == BL_PC ) {
	 switch( t_bl->type ) {
		 case BL_MOB: // Source => PC, Target => MOB
Index: battle.h
===================================================================
--- battle.h	(revision 16821)
+++ battle.h	(working copy)
@@ -3,6 +3,7 @@

#ifndef _BATTLE_H_
#define _BATTLE_H_
+#include "mapreg.h"

// state of a single attack attempt; used in flee/def penalty calculations when mobbed
typedef enum damage_lv {

script

-	script	woe	-1,{
OnWhisperGlobal:
announce "woe started", 0;
for ( .@i = 1; .@i <= 5; .@i++ )
	monster "prontera", 149 + .@i *3, 185, "Emperium No."+ .@i, 2900 + .@i, 1, strnpcinfo(0)+"::On"+ .@i;
end;
On1: callsub L_down, 1;
On2: callsub L_down, 2;
On3: callsub L_down, 3;
On4: callsub L_down, 4;
On5: callsub L_down, 5;
L_down:
announce strcharinfo(2) +" has broken Emperium No. "+ getarg(0), 0;
setd "$@woe_5emp_"+ getarg(0), getcharid(2);
monster "prontera", 149 + getarg(0) *3, 185, "Emperium No."+ getarg(0), 2900 + getarg(0), 1, strnpcinfo(0)+"::On"+ getarg(0);
end;
}

ok, this is still a sketch script,

but since the idea has been become real,

now its better to get the topic roll faster

still, you still missing

- tell how the victory condition properly

- *EDIT* confirm this is a pvp/gvg/ or battleground script

- and the MAP !!

btw, did anyone experience having client crash when multi-client ?

especially login in this prontera map, having shown this emperium stuff

EDIT:

seems to be cause by emperium id 1288 inside mob_avail

when change 1288 into 1915 doesn't give gravity error ... hmm ...

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

this is a very very good idea, I hope someone which is good in mapping can make a map for this

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:  

actually I also think that's the problem

I noticed most of the maps in graphic release section are either custom towns or marketplace ...

its very rare to see them makes an event map

... only a few pvp map, not even 1 gvg map or battleground maps

because they don't know how to write event script themselves !

... with the exception of Aerie ....

and yes ... without a map, this topic discussion will not go anywhere

maybe can try find an official RO map to substitute in

I also think we from scripting section side should work together with members from graphic section more often

like this and this

heh ... kinda fun make something extraordinary once in a while

EDIT:

hmm ... this also counts

just browse through that section and can't seem to find a good one for this

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

FINALLY !!! ARRRRGGGHHH !!!

I finished the script in less than 10 minutes, but took me over 3 hours to write out battle.c, so noob me

sql-files

REPLACE INTO `mob_db2` VALUES (2901,'EMPERIUM_1','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2902,'EMPERIUM_2','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2903,'EMPERIUM_3','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2904,'EMPERIUM_4','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
REPLACE INTO `mob_db2` VALUES (2905,'EMPERIUM_5','Emperium','Emperium',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

db\mob_avail.txt

2901, 1288
2902, 1288
2903, 1288
2904, 1288
2905, 1288

diff

Index: battle.c
===================================================================
--- battle.c	(revision 16821)
+++ battle.c	(working copy)
@@ -5021,6 +5021,24 @@
 if( (s_bl = battle_get_master(src)) == NULL )
	 s_bl = src;

+	if ( s_bl->type == BL_PC && t_bl->type == BL_MOB ) {
+		struct map_session_data *sd = BL_CAST( BL_PC, s_bl );
+		struct mob_data *md = BL_CAST( BL_MOB, t_bl );
+		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) ) {
+			if ( md->class_ >= 2901 && md->class_ <= 2905 && battle_getcurrentskill(src) > 0 )
+				return 0;
+			if (
+			md->class_ == 2901 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_1" ) ) ||
+			md->class_ == 2902 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_2" ) ) ||
+			md->class_ == 2903 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_3" ) ) ||
+			md->class_ == 2904 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_4" ) ) ||
+			md->class_ == 2905 && sd->status.guild_id == mapreg_readreg( add_str( "$@woe_5emp_5" ) )
+			) {
+				return 0;
+			}
+		}
+	}
+
 if ( s_bl->type == BL_PC ) {
	 switch( t_bl->type ) {
		 case BL_MOB: // Source => PC, Target => MOB
Index: battle.h
===================================================================
--- battle.h	(revision 16821)
+++ battle.h	(working copy)
@@ -3,6 +3,7 @@

#ifndef _BATTLE_H_
#define _BATTLE_H_
+#include "mapreg.h"

// state of a single attack attempt; used in flee/def penalty calculations when mobbed
typedef enum damage_lv {

script

-	script	woe	-1,{
OnWhisperGlobal:
announce "woe started", 0;
for ( .@i = 1; .@i <= 5; .@i++ )
	monster "prontera", 149 + .@i *3, 185, "Emperium No."+ .@i, 2900 + .@i, 1, strnpcinfo(0)+"::On"+ .@i;
end;
On1: callsub L_down, 1;
On2: callsub L_down, 2;
On3: callsub L_down, 3;
On4: callsub L_down, 4;
On5: callsub L_down, 5;
L_down:
announce strcharinfo(2) +" has broken Emperium No. "+ getarg(0), 0;
setd "$@woe_5emp_"+ getarg(0), getcharid(2);
monster "prontera", 149 + getarg(0) *3, 185, "Emperium No."+ getarg(0), 2900 + getarg(0), 1, strnpcinfo(0)+"::On"+ getarg(0);
end;
}

ok, this is still a sketch script,

but since the idea has been become real,

now its better to get the topic roll faster

still, you still missing

- tell how the victory condition properly

- *EDIT* confirm this is a pvp/gvg/ or battleground script

- the MAP !!!!!!

btw, did anyone experience having client crash when multi-client ?

especially login in this prontera map, having shown this emperium stuff

EDIT:

seems to be cause by emperium id 1288 inside mob_avail

when change 1288 into 1915 doesn't give gravity error ... hmm ...

actually I also think that's the problem

you see most of the maps in graphic release section are either custom towns or marketplace ...

very very very seldom a mapper make an event map

... only a few pvp map, not even 1 gvg map or battleground maps

because they don't know how to write event script themselves !

... with the exception of Aerie ....

and yes ... without a map, this topic discussion will not go anywhere

maybe can try find an official RO map to substitute in

I also think we from scripting section side should work together with members from graphic section more often

like this and this

heh ... kinda fun make something extraordinary once in a while

EDIT:

hmm ... this also counts

just browse through that section and can't seem to find a good one for this

Oh Annie /lv I can't believe you actually took so much of your time to try this even though it was quite an empty idea.

Hmm the idea seems to be similar to what Olrox posted in the eAthena board but with some slight differences. I wonder what happened to that release though?

Anyway to answer your questions Annie,

  • This is a GvG script. Winner to own a castle.
  • I don't have a map for it yet. Originally I was going to cut and paste a few of the official RO castle maps and link them together to make a map for it. I'll explain more regarding the "players gets kicked out when an Emperium gets capture" when I can get a mouse and draw the rough layout using MS Paint. (EDIT : Map and explanation below)
  • There is only 1 victory condition. The guild that captured the most Emperiums wins. However, since there is more then 1 Emperium, there will most likely be draws. When a draw occurs, the following rules will decide the winner.

  1. If there is a draw between the castle owner and another guild, (e.g. the both captured 3 emperiums each), the castle owner automatically wins [Castle owner privilages as it makes it more challenging]
  2. If there is a draw between 2 different guilds, both are not castle owners, a point system will decide the winner

The point system will be roughly explained here... I'm not very good at scripting (still learning...) yet so I'll try my best to explain it /hmm

To make it easier to understand, I'll use the guild name [Heaven] and [Hell]. Assume both of these guilds are not the current castle owner.

When an Emperium is captured by [Heaven], there will be an invisible score increasing. Maybe 1 point for every minute they hold an emperium. This can be multiplied by the amount of Emperiums they have captured. (E.g. [Heaven] has captured 3 Emperiums, they get 1 point X3 every 5 seconds) Each score should be kept by the Emperium. Meaning if they lose the Emperium to another guild, all the score they obtain from that Emperium will be lost.

Assuming at the end of WoE hours,

Guilds [Heaven] has captured 3 emperiums for 20 minutes each (3 x 20 = 60 points) and guild [Hell] has captured 3 emperiums for 15 minutes each (3 x 15 = 45 points). However, guild [Heaven] has been holding the Emperiums for longer then [Hell] and thus has more points. Therefore [Heaven] wins.

In the event that even the point system is unable to decide a winner, which is both guilds have 3 emperiums and equal amount of points (i wonder what are the chances of this happening), the castle reverts to neutral and nobody will own the castle.

EDIT

UuVi6.png

Sorry for the horribly drawn map... I'm totally useless in drawing. Anyway, this is roughly what I had in mind.

The middle map is the entrance to the castle. After entering the castle, there will be 8 different maps. Each map is a totally different map (meaning you will need to go through a loading screen).

Yellow rooms are Emperium rooms.

The purple room is a special room that only the current castle owners has access. In there they will get special privileges as I mentioned before.

The current castle owners are able to warp into the purple room directly from town.

-The guild gets a special NPC that warps the current castle owner guild members ONLY

In the purple room there will be an NPC that warps them nearer to the Emperium, which is the brown rooms. (It allows them to skip the castle main hall which MIGHT become a huge battleground area since thats where everyone has to enter from? If too imbalanced/unfair, more entrances into the castle can be considered)

-The guild leader/members get access to a special monitor room that contains NPC which will allow them to know who are the current holders for all the emperiums and maybe a warp to get nearer to the emperiums?

And whatever else special privileges that only castle owner will get are all located in purple rooms.

I hope its not too complicated to understand /oops

If you have anything else you would like to know feel free to ask. Its easier for me to give you the details by answering questions then describing them /ok

EDIT 2 : It seems pretty similar to the project you are working with Olrox here /shy:meow: Perhaps it could work together?

Edited by Xhiro
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:  

damn ... if everyone can make explanation like this in script request section ... I'm sure script request section will become very interesting

I think I can handle the script part, no problem

however currently Olrox is currently making this

WoE EX Castles by Olrox [Free Release Project] - Morroc theme

I'm not sure if he is interested to adjust his current project to substitute yours

still, we missing map designer for this

I think I try out with Olrox 1st, then ...

since I've work together with Olrox and DevilEvil before, next one I always want to try is Syouji

EDIT:

no, I don't think this woe and that battleground script can merge together ...

this script (gvg) and that script (battleground) is totally different ones ...

but still, I think I'll try contact a few map designers that like to take part in this one

EDIT2:

seems like there's 7 emperium rooms, its a prime number

so its hardly can get same ... unless its 3-3-1, oh well

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

damn ... if everyone can make explanation like this in script request section ... I'm sure script request section will become very interesting

I think I can handle the script part, no problem

however currently Olrox is currently making this

WoE EX Castles by Olrox [Free Release Project] - Morroc theme

I'm not sure if he is interested to adjust his current project to substitute yours

still, we missing map designer for this

I think I try out with Olrox 1st, then ...

since I've work together with Olrox and DevilEvil before, next one I always want to try is Syouji

EDIT:

no, I don't think this woe and that battleground script can merge together ...

this script (gvg) and that script (battleground) is totally different ones ...

but still, I think I'll try contact a few map designers that like to take part in this one

EDIT2:

seems like there's 7 emperium rooms, its a prime number

so its hardly can get same ... unless its 3-3-1, oh well

Well I don't really know anyone who is particularly good at mapping. I was actually satisfied to just use edited [cut and paste] maps. But if anyone is willing to help me with this I would be extremely happy :meow:/thx

The script is supposed to be WoE so it is possible that a draw occurs since there can easily be more then 2 guilds competing for the castle.

Thanks Annie for helping me out /lv

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

I think this will be my first post in the script forums. Thanks to Annnie ;D

I think you will need more than 1 mapper to do this :P

Making 8 separated woe themed small size maps, will be quite of work. Unless you want to make them look pretty similar of the original WoE 1.0 castles, but there are still 8 maps either.

Doing this alone will take me a lot of time. And I'm not sure but maybe other mappers will encounter the same.

To me, my only way to make this possible is by working on it as a cooperative work with other mapper. Working on it with Syouji would be okay with me, unless Syouji considers and has the time to do this amount of maps by his ownself I would let him do it alone.

So please ask Syouji to post here and tell us what he thinks.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

I think this will be my first post in the script forums. Thanks to Annnie ;D

I think you will need more than 1 mapper to do this :P

Making 8 separated woe themed small size maps, will be quite of work. Unless you want to make them look pretty similar of the original WoE 1.0 castles, but there are still 8 maps either.

Doing this alone will take me a lot of time. And I'm not sure but maybe other mappers will encounter the same.

To me, my only way to make this possible is by working on it as a cooperative work with other mapper. Working on it with Syouji would be okay with me, unless Syouji considers and has the time to do this amount of maps by his ownself I would let him do it alone.

So please ask Syouji to post here and tell us what he thinks.

Hi Olrox, thanks for even considering this project. Regarding the amount of maps required, I don't know if its neccesary to have 8 seperate maps. My thoughts was that it would be easier for some scripts to work if the maps are seperated and it would cause less strain on the server (or map or client? I'm not sure how this works) cause if it happens that many guilds fight for emperiums on the same map, there would be a lot of graphics and other stuff loading at the same time which could cause lag.

The amount of maps could be reduced to perhaps 5 since I believe it will be a challenge to get a good amount of people to compete in this WoE properly in a server.

Note : Sorry if I'm talking in circles or don't make any sense in this post... I'm currently having a headache trying to figure out multiple things about RO at the same time.

Edit : Edited to make it easier to understand... hopefully.

Edit : I PM'ed Syouji (seems like Annie PM'ed him too). Anyway this is his reply

Hello!

AnnieRuri messaged me regarding this project as well. I'll tell you what I told her. I can't make a committment at the moment due to my current workload in school (uni). I'm battling through midterms, projects, and then shortly after.. exams. So what I'm thinking is helping out during the Christmas break if the project is still moving forward.

Regards,

Syouji

Edited by Xhiro
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:  

this is one of the most fun script I've written in once in a while

I remember the last time I made some algorithm script like this was when I tried to write ladder system

sql-files

replace into mob_db2 values ( 2901,'EMPERIUM_1','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
replace into mob_db2 values ( 2902,'EMPERIUM_2','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
replace into mob_db2 values ( 2903,'EMPERIUM_3','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
replace into mob_db2 values ( 2904,'EMPERIUM_4','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
replace into mob_db2 values ( 2905,'EMPERIUM_5','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
replace into mob_db2 values ( 2906,'EMPERIUM_6','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
replace into mob_db2 values ( 2907,'EMPERIUM_7','Emperium2','Emperium2',90,5,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );

db\mob_avail.txt

2901, 1915
2902, 1915
2903, 1915
2904, 1915
2905, 1915
2906, 1915
2907, 1915

diff

Index: battle.c
===================================================================
--- battle.c	(revision 16821)
+++ battle.c	(working copy)
@@ -5021,6 +5021,21 @@
 if( (s_bl = battle_get_master(src)) == NULL )
	 s_bl = src;

+	if ( s_bl->type == BL_PC && t_bl->type == BL_MOB ) {
+		struct map_session_data *sd = BL_CAST( BL_PC, s_bl );
+		struct mob_data *md = BL_CAST( BL_MOB, t_bl );
+		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) ) {
+			int i; char str[23];
+			if ( md->class_ >= 2901 && md->class_ <= 2907 && battle_getcurrentskill(src) > 0 )
+				return 0;
+			for ( i = 0; i < 7; i++ ) {
+				sprintf( str, "$@woe_7ele_%d", i +1 );
+				if ( md->class_ == 2901 + i && sd->status.guild_id == mapreg_readreg( add_str(str) ) )
+					return 0;
+			}
+		}
+	}
+
 if ( s_bl->type == BL_PC ) {
	 switch( t_bl->type ) {
		 case BL_MOB: // Source => PC, Target => MOB
Index: battle.h
===================================================================
--- battle.h	(revision 16821)
+++ battle.h	(working copy)
@@ -3,6 +3,7 @@

#ifndef _BATTLE_H_
#define _BATTLE_H_
+#include "mapreg.h"

// state of a single attack attempt; used in flee/def penalty calculations when mobbed
typedef enum damage_lv {

npc script

prontera,152,191,5	script	woe	100,{
detachrid;
if ( agitcheck() )
	agitend;
else
	agitstart;
end;
OnAgitStart:
announce "woe started", 0;
for ( .@i = 1; .@i <= 7; .@i++ ) {
	monster "prontera", 144 + .@i *3, 185, "Emperium No."+ .@i, 2900 + .@i, 1, strnpcinfo(0)+"::On"+ .@i;
	.score[.@i] = 0;
	setd "$@woe_7ele_"+ .@i, 0;
}
while ( agitcheck() ) {
	for ( .@i = 1; .@i <= 7; .@i++ ) {
		if ( getd( "$@woe_7ele_"+ .@i ) )
			.score[.@i]++;
	}
	sleep 1000; // supposed to be 5000, but 1000 for test purposes
}
end;
On1: callsub L_down, 1;
On2: callsub L_down, 2;
On3: callsub L_down, 3;
On4: callsub L_down, 4;
On5: callsub L_down, 5;
On6: callsub L_down, 6;
On7: callsub L_down, 7;
L_down:
announce strcharinfo(2) +" has broken Emperium No. "+ getarg(0), 0;
setd "$@woe_7ele_"+ getarg(0), getcharid(2);
.guild_name$[ getarg(0) ] = strcharinfo(2);
monster "prontera", 144 + getarg(0) *3, 185, "Emperium No."+ getarg(0), 2900 + getarg(0), 1, strnpcinfo(0)+"::On"+ getarg(0);
.score[ getarg(0) ] = 0;
end;
OnAgitEnd:
announce "woe ended", 0;

for ( .@i = 1; .@i <= 7; .@i++ )
	killmonster "prontera", strnpcinfo(0) +"::On"+ .@i;

for ( .@i = 1; .@i <= 7; .@i++ )
	if ( getd( "$@woe_7ele_"+ .@i ) )
		announce "[Debug] "+ .guild_name$[.@i] +" holding emp.no."+ .@i +" for "+ .score[.@i] +" points", 0;

for ( .@i = 1; .@i <= 7; .@i++ ) {
	if ( getd( "$@woe_7ele_"+ .@i ) ) {
		.@j = 0;
		.@size = getarraysize(.@most_holding_guild_id);
		while ( getd( "$@woe_7ele_"+ .@i ) != .@most_holding_guild_id[.@j] && .@j < .@size )
			.@j++;
		if ( .@j == .@size ) {
			.@most_holding_guild_id[ .@size ] = getd( "$@woe_7ele_"+ .@i );
			.@most_holding_flags[ .@size ] = 1;
		}
		else
			.@most_holding_flags[ .@j ]++;
	}
}
.@size = getarraysize(.@most_holding_guild_id);

if ( .@size == 1 ) {
	announce "Guild ["+ getguildname( .@most_holding_guild_id[ .@size -1 ] ) +"] holding all the emperiums !! Wins !", 0;
	end;
}

callfunc "comb_sort", .@most_holding_guild_id, .@most_holding_flags; // WTF !!!! my 1st time use sorting algorithm

for ( .@i = 0; .@i < .@size; .@i++ )
	announce "[Debug] Guild ["+ getguildname( .@most_holding_guild_id[.@i] ) +"] holding "+ .@most_holding_flags[.@i] +" emperium total", 0;

if ( .@most_holding_flags[ .@size -1 ] != .@most_holding_flags[ .@size -2 ] ) {
	announce "Guild ["+ getguildname( .@most_holding_guild_id[ .@size -1 ] ) +"] holding "+ .@most_holding_flags[ .@size -1 ] +" emperium total !! Wins !", 0;
	end;
}
else
	announce "[Debug] TIE !! Start counting invisible points system", 0;

for ( .@i = 1; .@i <= 7; .@i++ ) {
	if ( getd( "$@woe_7ele_"+ .@i ) ) {
		.@j = 0;
		.@size = getarraysize(.@most_points_guild_id);
		while ( getd( "$@woe_7ele_"+ .@i ) != .@most_points_guild_id[.@j] && .@j < .@size )
			.@j++;
		if ( .@j == .@size ) {
			.@most_points_guild_id[ .@size ] = getd( "$@woe_7ele_"+ .@i );
			.@most_points_flags[ .@size ] = .score[.@i];
		}
		else
			.@most_points_flags[ .@j ] += .score[.@i];
	}
}

.@size = getarraysize(.@most_points_guild_id);

callfunc "comb_sort", .@most_points_guild_id, .@most_points_flags;

for ( .@i = 0; .@i < .@size; .@i++ )
	announce "[Debug] Guild ["+ getguildname( .@most_points_guild_id[.@i] ) +"] has "+ .@most_points_flags[.@i] +" points total", 0;

if ( .@most_points_flags[ .@size -1 ] != .@most_points_flags[ .@size -2 ] ) {
	announce "Guild ["+ getguildname( .@most_points_guild_id[ .@size -1 ] ) +"] has "+ .@most_points_flags[ .@size -1 ] +" points total !! Wins !", 0;
	end;
}
else
	announce "[Debug] TIE !! oh well ... I'm lazy to do the rest already", 0;
end;
}

//	callfunc "comb_sort", <array of IDs>, <array of points to be sorted>;
function	script	comb_sort	{
.@size = getarraysize( getarg(0) );
.@gap = .@size;
do {
	if ( .@gap > 1 )
		.@gap = .@gap * 100 / 130;
	.@swap = 0;
	.@i = 0;
	while ( .@i + .@gap < .@size ) {
		if ( getelementofarray( getarg(1), .@i ) > getelementofarray( getarg(1), .@i + .@gap ) ) {
			.@tmp = getelementofarray( getarg(0), .@i );
			set getelementofarray( getarg(0), .@i ), getelementofarray( getarg(0), .@i + .@gap );
			set getelementofarray( getarg(0), .@i + .@gap ), .@tmp;
			.@tmp = getelementofarray( getarg(1), .@i );
			set getelementofarray( getarg(1), .@i ), getelementofarray( getarg(1), .@i + .@gap );
			set getelementofarray( getarg(1), .@i + .@gap ), .@tmp;
			.@swap = 1;
		}
		.@i++;
	}
} while ( .@swap || .@gap > 1 );
return;
}

actually I have some kind of idea turn this into woe - 7 elements

where there's sky, fire, water, wind, wood ... 7 colors of emperiums in those rooms ( sky room has gonryun theme, fire has magma dungeon theme etc )

and if the guild owner owns fire and water emperium, in the next war they have +10 str and +10 int stats when they stay in the map

which is do-able with

OnPCStatCalcEvent:

if ( strcharinfo(3) == "that_room" && getcharid(2) == $woe_7ele_holder ) {

if ( $woe_7ele_bits & 1 ) bonus bstr, 100; // hold fire room in previous round gets bonus str

if ( $woe_7ele_bits & 2 ) bonus bint, 100; // hold water room gets int bonus ..

if ( $woe_7ele_bits & 4 ) bonus .... // hold wind gets agi bonus ... and so on

damn if you can pick up map designing skills, I don't mind finish this script off

the idea is very good by itself

EDIT:

forgot to tell this script cannot advance any further if there's no map provided

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

Opps missed your reply as it got pushed down by the new topics.

That sounds kind of interesting regarding the 7 elements although somehow I believe every guild will want the +10 Dex room for their wizards to instant cast /hmm

I would really love to work on map editing but with the workload I have in my normal life, it's not possible any time soon. Sadly I can only hope that a mapper may help out for this.

Hmm... I may consider paying to get this map done unless someone decides to help out for free. /shy

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