• 0
Seravy

Custom "Woe"

Question

Asking here because I haven't yet had the time to check whether woe is implemented in script, source or both.

I'm playing on my own offline server, so that obviously means no PVP or WOE, as there are no other players. However it would be a waste to not use the castles. So I have been thinking to implement the following instead :

-Every X hours (while the server is turned on) there is a chance for each owned castle to be retaken by monsters, or if it's already owned by monsters, chance to lose an investment level.

-Treasure does not respawn except after the castle is taken from the monsters and you can invest only once.

-Monsters grow stronger the more investment levels there are so each time it's harder to retake the castle (but higher investment means more treasure chest as usual)

-Woe is always enabled so I can take the castles from the monsters whenever I feel like doing it.

That's all I think. Also, no idea how the guardians could be incorporated into this system, if at all, might be better to get rid of them. How difficult/possible it is do this? Is it as easy as changing some scripts or is it harder? Is it even possible to change the level of the monsters spawned? Do Woe SE castles work the same way as normal castles regarding monsters/chests/investing zeny, so can the same be done for them? It wasn't implemented last time I played so I know nothing about it.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

100% scripting
btw scripting is my absolute strong point

4 hours ago, Seravy said:

-Every X hours (while the server is turned on) there is a chance for each owned castle to be retaken by monsters, or if it's already owned by monsters, chance to lose an investment level.

https://irowiki.org/wiki/War_of_Emperium#Benefits

-	script	ksdjfs	FAKE_NPC,{
OnMinute00:
	for ( .@i = 0; .@i < 20; ++.@i ) {
		if ( getcastledata( .castle$[.@i], CD_GUILD_ID ) ) {
			if ( rand(100) < 50 ) { // 50% chance
				setcastledata .castle$[.@i], CD_GUILD_ID, 0;
				donpcevent "Agit#"+ .castle$[.@i] +"::OnStartArena";
			}
		}
		else {
			if ( rand(100) < 50 ) // 50% chance
				setcastledata .castle$[.@i], CD_CURRENT_ECONOMY, getcastledata( .castle$[.@i], CD_CURRENT_ECONOMY ) - 5;
		}
	}
	end;
OnInit:
	setarray .castle$[0],
		"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";
	end;
}

 

 

4 hours ago, Seravy said:

-Treasure does not respawn except after the castle is taken from the monsters ....

 npc/guild/agit_main.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/npc/guild/agit_main.txt b/npc/guild/agit_main.txt
index c2925487c..964e701fb 100644
--- a/npc/guild/agit_main.txt
+++ b/npc/guild/agit_main.txt
@@ -1135,8 +1135,8 @@ OnClock0001:
 	
 	set .@GID, GetCastleData(strnpcinfo(2),CD_GUILD_ID);
 	
-	// If there is no owner, do nothing.
-	if (!.@GID) end;
+	// only spawn treasure chest when there is no owner
+	if (.@GID) end;
 
 	// Is there Economy in this castle?
 	set .@Treasure,GetCastleData(strnpcinfo(2),CD_CURRENT_ECONOMY)/5+4;

 

 

4 hours ago, Seravy said:

... and you can invest only once.

 npc/guild/agit_main.txt | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/npc/guild/agit_main.txt b/npc/guild/agit_main.txt
index c2925487c..abe5c3cda 100644
--- a/npc/guild/agit_main.txt
+++ b/npc/guild/agit_main.txt
@@ -657,22 +657,18 @@ OnRecvCastle:
 		else if ((.@Economy >= 86) && (.@Economy <= 90)) { set .@eco_invest,770000; }
 		else if ((.@Economy >= 91) && (.@Economy <= 95)) { set .@eco_invest,860000; }
 		else if ((.@Economy >= 96) && (.@Economy <= 100)) { set .@eco_invest,955000; }
-		//Quadruple the cost of investing if you've already invested once.
-		if (GetCastleData(strnpcinfo(2),CD_INVESTED_ECONOMY)) {
-			set .@eco_invest,.@eco_invest*4;
-		}
 		mes "["+strnpcinfo(1)+"]";
 		mes "If you invest in commercial growth, the quantity of goods made by the guild will increase. Therfore, if you consider our future, investments will be a necessity.";
 		mes " ";
-		mes "Initially, you are able to invest just once but if you pay more money, you will be able to invest twice.";
+		mes "You are able to invest just once.";
 		if (.@Economy >= 100) {
 			mes " ";
 			mes "^ff0000The commercial growth level of our Castle is at it's highest, 100%. No more investments are needed. Just as I have expected from a great economist like you, Master.^000000";
 			close;
 		}
-		if (GetCastleData(strnpcinfo(2),CD_INVESTED_ECONOMY) >= 2) {
+		if (GetCastleData(strnpcinfo(2),CD_INVESTED_ECONOMY) >= 1) {
 			mes " ";
-			mes "^ff0000You have already invested twice today. You cannot invest any more.^000000 I expect riches of the guild to grow at a high rate.";
+			mes "^ff0000You have already invested today. You cannot invest any more.^000000 I expect riches of the guild to grow at a high rate.";
 			close;
 		}
 		if (GetCastleData(strnpcinfo(2),CD_INVESTED_ECONOMY) == 0) {

 

 

4 hours ago, Seravy said:

-Monsters grow stronger the more investment levels there are so each time it's harder to retake the castle (but higher investment means more treasure chest as usual)

 npc/guild/agit_main.txt | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/npc/guild/agit_main.txt b/npc/guild/agit_main.txt
index c2925487c..fd76a0582 100644
--- a/npc/guild/agit_main.txt
+++ b/npc/guild/agit_main.txt
@@ -177,17 +177,57 @@ OnRecvCastle:
 		if (compare(strnpcinfo(2),"aldeg")) {
 			// Normal Spawns
 			monster strnpcinfo(2),0,0,"Evil Druid",1117,10;
+			for ( .@i = 0; .@i < 10; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1117, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1117, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Khalitzburg",1132,4;
+			for ( .@i = 0; .@i < 4; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1132, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1132, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Abysmal Knight",1219,2;
+			for ( .@i = 0; .@i < 2; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1219, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1219, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Executioner",1205,1;
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1205, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1205, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;
 			monster strnpcinfo(2),0,0,"Penomena",1216,10;
+			for ( .@i = 0; .@i < 10; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1216, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1216, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Alarm",1193,18;
+			for ( .@i = 0; .@i < 18; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1193, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1193, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Clock",1269,9;
+			for ( .@i = 0; .@i < 9; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1269, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1269, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Raydric Archer",1276,7;
+			for ( .@i = 0; .@i < 7; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1276, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1276, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Wanderer",1208,3;
+			for ( .@i = 0; .@i < 3; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1208, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1208, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;	
+			}
 			monster strnpcinfo(2),0,0,"Alice",1275,1;
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1275, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1275, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;
 			monster strnpcinfo(2),0,0,"Bloody Knight",1268,1;
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1268, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1268, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;
 			monster strnpcinfo(2),0,0,"Dark Lord",1272,1;
+				setunitdata [email protected][.@i], UMOB_MAXHP, getmonsterinfo( 1272, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100; 
+				setunitdata [email protected][.@i], UMOB_HP, getmonsterinfo( 1272, MOB_MAXHP ) * getcastledata( strnpcinfo(2), CD_CURRENT_ECONOMY ) / 100;
 			// Set Emperium room spawn coordinates and spawn monsters.
 			if (strnpcinfo(2) == "aldeg_cas01") { setarray .@emproom[0],216,23; }
 			else if (strnpcinfo(2) == "aldeg_cas02") { setarray .@emproom[0],213,23; }

lazy to do the rest ... anyway you get the point

 

 

4 hours ago, Seravy said:

-Woe is always enabled so I can take the castles from the monsters whenever I feel like doing it.

disable the npc/guild/agit_controller.txt file and use this

-	script	ksdjfs	FAKE_NPC,{
OnInit:
	agitstart;
	end;
}

 

 

4 hours ago, Seravy said:

Also, no idea how the guardians could be incorporated into this system, if at all, might be better to get rid of them.

 npc/guild/agit_main.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/npc/guild/agit_main.txt b/npc/guild/agit_main.txt
index c2925487c..d979649fa 100644
--- a/npc/guild/agit_main.txt
+++ b/npc/guild/agit_main.txt
@@ -769,6 +769,8 @@ OnRecvCastle:
 		}
 	case 4:
 		mes "["+strnpcinfo(1)+"]";
+		mes "Summon a Guardian is disabled";
+		close;
 		mes "Will you summon a Guardian? It'll be a protector to defend us loyally.";
 		mes "Please select a guardian to defend us.";
 		next;

 

 

4 hours ago, Seravy said:

How difficult/possible it is do this? Is it as easy as changing some scripts or is it harder?

for me, it is easy as 1 2 3 , A B C

 

 

4 hours ago, Seravy said:

Is it even possible to change the level of the monsters spawned?

 npc/guild/agit_main.txt | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/npc/guild/agit_main.txt b/npc/guild/agit_main.txt
index c2925487c..133012e87 100644
--- a/npc/guild/agit_main.txt
+++ b/npc/guild/agit_main.txt
@@ -177,17 +177,45 @@ OnRecvCastle:
 		if (compare(strnpcinfo(2),"aldeg")) {
 			// Normal Spawns
 			monster strnpcinfo(2),0,0,"Evil Druid",1117,10;
+			for ( .@i = 0; .@i < 10; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Khalitzburg",1132,4;
+			for ( .@i = 0; .@i < 4; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Abysmal Knight",1219,2;
+			for ( .@i = 0; .@i < 2; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Executioner",1205,1;
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
 			monster strnpcinfo(2),0,0,"Penomena",1216,10;
+			for ( .@i = 0; .@i < 10; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Alarm",1193,18;
+			for ( .@i = 0; .@i < 18; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Clock",1269,9;
+			for ( .@i = 0; .@i < 9; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Raydric Archer",1276,7;
+			for ( .@i = 0; .@i < 7; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;	
+			}
 			monster strnpcinfo(2),0,0,"Wanderer",1208,3;
+			for ( .@i = 0; .@i < 3; ++.@i ) {
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
+			}
 			monster strnpcinfo(2),0,0,"Alice",1275,1;
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
 			monster strnpcinfo(2),0,0,"Bloody Knight",1268,1;
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
 			monster strnpcinfo(2),0,0,"Dark Lord",1272,1;
+				setunitdata [email protected][.@i], UMOB_LEVEL, 99;
 			// Set Emperium room spawn coordinates and spawn monsters.
 			if (strnpcinfo(2) == "aldeg_cas01") { setarray .@emproom[0],216,23; }
 			else if (strnpcinfo(2) == "aldeg_cas02") { setarray .@emproom[0],213,23; }

change all monsters to level 99

 

 

4 hours ago, Seravy said:

Do Woe SE castles work the same way as normal castles regarding monsters/chests/investing zeny, so can the same be done for them?

yes,
1. it happens to be using agitstart2 ...
2. use npc\guild2 folder ...
3. rathena also has woe training edition ...

 

 

btw you ask too many question at once

Edited by AnnieRuru
  • Love 3

Share this post


Link to post
Share on other sites
  • 0

Please read the whole thing before posting any answers, as I kept updating it and figured a lot of things out as I made progress.

o_O sorry about all the questions, I wasn't expecting an answer this detailed, just wanted to be sure I don't jump into this and find out I can't do it after wasting a lot of time trying.

All scripting, easy, good news, I'll try to get all of it done today then.

Managed to make monsters take back castles at chance as well as reduce economy, also commented out the lines that make economy levels drop when emperium is broken as that's now unnecessary functionality.

I tried your treasure spawn change but it doesn't work. I want the treasure to spawn at the time I break the emperium, exactly once, and never again, until the monsters retake the castle and I clean it out again. "onClock0001" seems to be "do this at midnight" if I understand correctly, so instead, I need the treasure spawn to be turned into a function, which I can call from where the emperium is broken I believe. I'll update this post when there is more progress, it shouldn't be too hard to figure out the correct syntax for that.  Couldn't figure out how to make it a procedure but copying the treasure spawn script as is to where the emperium breaks works. I only need it to be executed then, so it doesn't really need to be a procedure. Also removed the onClock0001 line, that should be enough to disable daily respawns. So this is now also solved.

Seems investment only takes effect as part of the treasure spawns. Had to change that as well, to apply when the investment is made, wasn't too hard. Maybe I have some use for the guardians after all - if branches can be used in castles and the guardians spawn, they can help killing those mobs. Nothing spectacular but it's something... better than outright disabling the feature.

Looks like the castle can be conquered from monsters when WOE is off anyway, so I removed the activation timer file and added nothing to replace it.

Somewhat confused on the monster level thing. Do I need to raise monster stats separately, or does raising the level automatically adjust all their stats as if the monster leveled up? (How much stats do monsters gain from leveling anyway, never played with monster level up enabled...)

...maybe I'll scale the type and quantity of mobs instead of their level and stats, idk, might be a better solution. I guess I'll experiment with it and see for myself how it works. Ok, testing shows changing monster level doesn't make it stronger. So I have to change the stats as well if I want them to grow stronger. Okay, not entirely sure what stats need to be changed. there is MINATK, MAXATK, MINMATK MAXMATK but that doesn't make sense to me. These are values calculated from base stats, aren't they? I'm completely unsure which of these I need to modify... I mean a monster only has one atk and one matk stat in the database. Min and max are calculated... (although matk is mislabeled as maxatk but that bug was already fixed in that recent update...)

..oh MOB and UMOB are different things.  I think I need to set MOB not UMOB as UMOB seem to be the already calculated values? Wouldn't they get overwritten as soon as the monster is recalculated (for example buffed by a status)? Arrgh this is definitely not trivial at all. Oh, docs\script_commands is a thing. Time to read...well

"Note: When adjusting a unit's stat (STR, AGI, etc) the unit's respective statuses are
      recalculated (HIT, FLEE, etc) automatically. Keep in mind that some stats don't
      affect a unit's status and will have to directly be modified."

Ok, that doesn't really tell me what MIN/MAX ATK and MATK in script actually represent. I need to modify ATK and ATK2 that much I realized. 

    case UMOB_ATKMIN: md->base_status->rhw.atk = (unsigned short)value; calc_status = true; break;
    case UMOB_ATKMAX: md->base_status->rhw.atk2 = (unsigned short)value; calc_status = true; break;
    case UMOB_MATKMIN: md->base_status->matk_min = (unsigned short)value; calc_status = true; break;
    case UMOB_MATKMAX: md->base_status->matk_max = (unsigned short)value; calc_status = true; break;

Now let's try to find which of these are actually used for what...

	return status->int_ + level + status->rhw.matk * 70 / 100;

So... rhw.matk. None of those set that so as is script functionality to change monster MATK seems to be broken (probably due to the update that fixed monster matk) - you can only change the stats that get recalculated anyway. I guess I'll try to use it just to make sure it is indeed a bug, then change source to set rhw.matk...

so Heaven Drive damage/hit from Evil Druid

No script : 94 damage (my mdef is 54, no hard mdef, so monster matk was around 150)

Script "setunitdata [email protected][[email protected]], UMOB_MATKMIN, getmonsterinfo( getarg(1), MOB_ATK2 ) *4" for 4x MATK, code changed to set rhw.matk : same 94 damage (what??)

Same script but original source : 1313 damage pet hit...that's 10x more not 4x as specified...

omg both results are wrong. Well of course...

case MOB_ATK2:        script_pushint(st,mob->status.rhw.atk2); break;

That's the monster's max atk. There is no way to get the monster's base MATK from script at all it seems? More importantly those are not the base amounts, but the calculated ones... running in debug, for Evil Druid, rhw.atk is 302, rhw.atk2 is 453,  batk is 142,  rhw.matk is 68, matkmin is 172, matk_max is 213. The database entries for the monster are 378 and 68. 

So let's try to figure out what's what.

rhw.matk - this is the database matk stat. I need to get this but can't so I'll need a new MOB_MATK script parameter. I thought I also need to set this but for some reason that isn't the case. Maybe monster stats weren't actually recalculated from it?

batk - This is the monster's atk from its stats, we have nothing to do with this (setting level/str/dex/etc should deal with this part)

rhw.atk and rhw.atk2 - These are the 80 and 120% of the monster's database ATK stat. So getting and setting these should work for adjusting physical attack as long as they are not recalculated from the base stat.

matk_min and matk_max are the effective matk values. It's possible to set these but you can't "get" them from the database. However setting them should be wrong anyway. base matk should be set instead?

...in status.cpp, this :


	if((!(bl->type&BL_REGEN)) && (!sc || !sc->count)) { // No difference.
		status_cpy(status, b_status);
		return;
	}

what is it for? It makes the entire recalculation process skipped for the monster, so no wonder changing the correct, rhw.matk has no effect on  the calculated min and max matk... let's see,

///Define to determine who has regen
#define BL_REGEN (BL_PC|BL_HOM|BL_MER|BL_ELEM)

Oh, I get it. So that code says if the thing can't regenerate hp/sp and has no status effects on it, skip recalculation because there is no way anything actually changed. Isn't that...compeletely wrong to assume? Wouldn't this break monster stat recalculation from script in all cases (not just matk but STR, AGI, etc)?

...then here :

		status->matk_min = status_base_matk_min(bl, status, lv);
		status->matk_max = status_base_matk_max(bl, status, lv);

while using status instead of base_status is correct here because INT might have been already been changed by effects, and is used by the formula inside, "status->int_ + level + status->rhw.matk * 70 / 100;", it's also wrong because rhw.matk changes in base_status (through the script or otherwise) do not propagate to status anywhere. Status.rhw.matk=base_status.rhw.matk before these function calls seems necessary - unlike atk, matk isn't recalculated anywhere before the call. (or the script should set status instead of base status, or both.)

...adding that line to set status matk to base status matk fixed the problem. Raising monster matk now works, yay! However, raising atk is broken now as recalculation now correctly happens, but script sets base_status and again the data does not propagate to status anywhere.

status.cpp line 4979, these two lines were removed by that "fix monster matk" update we discussed last time that was committed in the past 6 months. However, without them, any changes by script to base_status.rhw.atk and atk2 never have an effect similarly to the matk one.

		status->rhw.atk = status_calc_watk(bl, sc, b_status->rhw.atk);
		status->rhw.atk2 = status_calc_watk(bl, sc, b_status->rhw.atk2);

Are these seriously all existing bugs? I'm not breaking things due to misunderstandings? I made a pull request just to be sure people in charge are at least aware of these problems and a possible way of fixing them. I should probably test other stats too, at this rate, there might be more broken than just atk and matk.

WOE+WOE SE+WOE TE total 40 castles but server says "loaded 44 castles" at startup, what are the last 4?

Edited by Seravy

Share this post


Link to post
Share on other sites
  • 0

no more edit ? ok time to reply this topic

 

On 2/21/2019 at 3:29 PM, Seravy said:

I tried your treasure spawn change but it doesn't work. I want the treasure to spawn at the time I break the emperium, exactly once, and never again, until the monsters retake the castle and I clean it out again. "onClock0001" seems to be "do this at midnight" if I understand correctly, so instead, I need the treasure spawn to be turned into a function, which I can call from where the emperium is broken I believe. I'll update this post when there is more progress, it shouldn't be too hard to figure out the correct syntax for that.  Couldn't figure out how to make it a procedure but copying the treasure spawn script as is to where the emperium breaks works. I only need it to be executed then, so it doesn't really need to be a procedure. Also removed the onClock0001 line, that should be enough to disable daily respawns. So this is now also solved.

Emperium is spawn by *monster script command, the event label indicate the execution of the specific label
in WOE:FE is OnAgitBreak, so just add donpcevent to the custom label that you have changed from OnClock0001:

 

 

On 2/21/2019 at 3:29 PM, Seravy said:

Looks like the castle can be conquered from monsters when WOE is off anyway, so I removed the activation timer file and added nothing to replace it.

castle can be conquered when there are no owner, and that's official
so for example, if the guild owns a guild castle and disband the guild, other guild can immediately rush into the castle can claim ownership right away

 

 

On 2/21/2019 at 3:29 PM, Seravy said:

Somewhat confused on the monster level thing. Do I need to raise monster stats separately, or does raising the level automatically adjust all their stats as if the monster leveled up? (How much stats do monsters gain from leveling anyway, never played with monster level up enabled...)

custom stuff, monster do not level up officially
however there is a custom mod, which already in the repo

conf/battle/monster.conf

// Monsters level up (monster will level up each time a player is killed and they will grow stronger)
// Exp rate is calculated ((monster level-original monster level)*(exp*(mobs_level_up_exp rate/100)))
// NOTE: Does not apply to WoE Guardians.
mobs_level_up: no
mobs_level_up_exp_rate: 1

reading the code, it seems only give extra experience gain for the player ... though

if you want to make monster tougher, maybe you can play around with this

 

 

On 2/21/2019 at 3:29 PM, Seravy said:

...maybe I'll scale the type and quantity of mobs instead of their level and stats, idk, might be a better solution. I guess I'll experiment with it and see for myself how it works. Ok, testing shows changing monster level doesn't make it stronger. So I have to change the stats as well if I want them to grow stronger. Okay, not entirely sure what stats need to be changed. there is MINATK, MAXATK, MINMATK MAXMATK but that doesn't make sense to me. These are values calculated from base stats, aren't they? I'm completely unsure which of these I need to modify... I mean a monster only has one atk and one matk stat in the database. Min and max are calculated... (although matk is mislabeled as maxatk but that bug was already fixed in that recent update...)

exactly

and you long long post about batk/watk/matk stuff,
just forget about it, this renewal and pre-renewal stuff actually break it,
a similar question also pop up in hercules, I also dunno how to solve it
http://herc.ws/board/topic/16580-how-to-make-matk-1-in-status_calc_pc_/

anyway, change the base stats first, then its custom calculation comes later

prontera,155,185,5	script	skdfjhsfkj	1_F_MARIA,{
	monster "this",-1,-1, "--ja--",1002,1, "";
	// change the base stat 1st
	setunitdata [email protected], UMOB_STR, 200;
	setunitdata [email protected], UMOB_DEX, 200;
	setunitdata [email protected], UMOB_INT, 200;
	setunitdata [email protected], UMOB_LUK, 200;
	setunitdata [email protected], UMOB_AGI, 200;
	setunitdata [email protected], UMOB_VIT, 200;
	// change the calculation later
	setunitdata [email protected], UMOB_MAXHP, 10000000;
	setunitdata [email protected], UMOB_HP, 10000000;
	setunitdata [email protected], UMOB_ATKMIN, 1;
	setunitdata [email protected], UMOB_ATKMAX, 1;
	setunitdata [email protected], UMOB_HIT, 1000;
	end;
}

 

 

 

On 2/21/2019 at 3:29 PM, Seravy said:

WOE+WOE SE+WOE TE total 40 castles but server says "loaded 44 castles" at startup, what are the last 4?

novice castles
https://github.com/rathena/rathena/blob/master/db/castle_db.txt#L35-L38

you can make your own woe castle script btw
https://annieruru.blogspot.com/2019/01/how-to-create-your-own-woe-castle-map.html

Share this post


Link to post
Share on other sites
  • 0

Tried a Yuno castle yesterday evening and found some unexpected differences. First of all the EMP room doesn't have specific spawns. This isn't a problem, I can make one, I just need to use the same code normal castles do. However,  EMP rooms don't seem to be "rooms", in fact I'm starting to vaguely remember SE being special in that there are no warps in the castles, the entire thing is connected. The problem with this is obvious, you can walk into the emp room and break it without fighting bosses, and even if I make a boss spawn at the emperium, it might move away and can be lured away as well.

So I decided to implement my original "plan B", require killing the monsters to get the castle. This doesn't seem to be overly difficult, I imagine starting the emp break script with "if there are monsters remaining, respawn emp, otherwise continue" is what I need. However... I want it to be limited to boss monsters only, and I want to display the boss monster's name, like "The Dark Lord has revived the Emperium! You must defeat him to gain ownership of this castle!". I'll try to figure out how to do this on my own, will edit this post if I fail or succeed. I also noticed breaking the emperium in SE castles does not kill the monsters. That's unusual, I'll have to change that too.

Novice castles... what are those? I tried a google search but found nothing. Is this an official feature? If it's woe for novices only, I don't think I'll bother with it.

I've sent a pull request with the fixes when I found the atk/matk problems, so far it's still open 2 full days later so the bug(s) seem to be real.

Edit  - this is as far as I was able to do it, now I'm stuck :

OnEmpSpawn:
	callsub(Emprespawn);
	end;
Emprespawn:
	set [email protected]$, substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9);
	if (mobcount(strnpcinfo(2),"Steward#"[email protected]$+"::OnStartArena")) end;
	if (compare(strnpcinfo(2),"arug")) {
		if (strnpcinfo(2) == "arug_cas01") setarray [email protected][0],87,219;
		else if (strnpcinfo(2) == "arug_cas02") setarray [email protected][0],89,256;
		else setarray [email protected][0],141,293;	// Castles 3,4,5 are identical.
	}
	else {
		if (strnpcinfo(2) == "schg_cas02") setarray [email protected][0],162,193;
		else if (strnpcinfo(2) == "schg_cas03") setarray [email protected][0],338,202;
		else setarray [email protected][0],120,272;	// Castles 1,4,5 are identical.
	}
	monster strnpcinfo(2),[email protected][0],[email protected][1],"Emperium",1288,1,"Steward#"[email protected]$+"::OnStartArena";
	return;

OnStartArena:
	set [email protected],getcharid(2);
	set [email protected]$, (compare(strnpcinfo(4),"arug"))?"Valfreyja":"Nithafjoll";
	
	[email protected] = getmapunits(BL_MOB,[email protected][0]);
	freeloop(1);	// for if the list was too big.
	for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++)
		getunitdata array[[email protected]],[email protected][0];
		if ([email protected][UMOB_MODE] == MD_MVP) {
		mapannounce [email protected][??? no UMOB_NAME???] +" revives the Emperium!";
		callsub(Emprespawn);
		end;
		}
	freeloop(0);
	
    // rest of the emperium break script is here

So basically, unless there are bugs in it, all I need is a way to get the monster's name.

Edited by Seravy

Share this post


Link to post
Share on other sites
  • 0
6 hours ago, Seravy said:

"The Dark Lord has revived the Emperium! You must defeat him to gain ownership of this castle!"

remove the emperium spawn from OnAgitStart: label
in guild2/agit_main_se.txt file, its under OnEmpSpawn:

change that emperium spawn into your custom boss spawn, with a custom event label
and the custom event label will trigger to spawn the emperium

 

6 hours ago, Seravy said:

Novice castles... what are those? I tried a google search but found nothing. Is this an official feature? If it's woe for novices only, I don't think I'll bother with it.

no idea honestly, this thing was already in eathena repo when I join eathena back then ... 12 years ago
https://github.com/rathena/rathena/tree/master/npc/events/nguild

 

6 hours ago, Seravy said:

So basically, unless there are bugs in it, all I need is a way to get the monster's name.

there are 2 similar script command for it in rathena
*rid2name and *getunitname, both do the same thing

 

.... I guess I don't need to provide a template, since you post "all I need is a way to get the monster's name." ...
although I still think its better to just summon a boss monster with event label, rather than loop with *getmapunits script command

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

Somewhat related, the TE castles seem to drop item 12399 which is a consumable treasure chest with no script that doesn't sell for zeny either. I did a search for the ID number in the npc folder and nothing came up. So it seems the item is entirely useless, but that can't be right? It's a (common) WOE reward item so it has to have some purpose? I smell a missing item script bug... but even RMS shows no script for that item. Any idea what that item is actually for? I don't want to edit it to generate zeny unless I'm 100% sure it's not an important quest material nor has some hardcoded effect handled by source. Even more confusing is the fact the same castles drop the normal, NPC sellable treasure chest item I'm already used to seeing. I tried searching but I only found information about the normal treasure chest item.

Share this post


Link to post
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.

Loading...