Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 08-25-2004, 04:05 AM   #1 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default Castle Assault

Summury
Castle Assult v0.66

Another my "war event" (See also Monster attack on towns here: white hue code need help)

This script produce castle and monsters spawn in it. Besides defenders the castle can also spawn 3 group of monsters to patrol the area. Players can assault the castle by breaking doors and enetering in the rooms. If boss monster is killed the castle stop respawn monsters and wait some times to restart. The boss monster have a small chance to drop rare artefact.
To break the doors players must click on doors. The chance of door break depends of character streght. To open the door players must "break" it 100 times by default.

Usage:
Unzip to custom folder.

In game:

Find flat location and put a castle somewhere:

[add EvilCastleSpawn

This will produce castle and some decoration on it. If you stick in the wall or floor use [tele to move to another location. In the middle of the castle you can see the sign - click it twice and the properties will shown. Here you can edit/look the properties:

active - this will activate entire system. Every internal tick the castle check the number of monsters in every defender group and respawn one monster in every incomplete group of defenders.

The one internal tick time is calculated by following formula -

time = rate + rate * (kills/rateValue)

Check the description of rate, kills and rateValue below.
For example if you kill 10 monsters, rateValue = 67 and rate = fast the castle will 'tick' every

time = 50 + 50*(10/67) =~ 57 second.

autorepair - If this is 'true' very internal tick time the castle will repair every breaked door with 1 unit.

complete / CompletionTime - show is the boss is killed and when this happends.

kills - number of killed monster-defenders. Decreased by one every internal tick.

maxArchersInGroup - number of archers in group

maxMagesInGroup - number of mages in group

maxWarriorsInGroup - number of warriors in group

rate - respawn rate

Slow means about 190 seconds
Normal means about 120 seconds
Fast means about 50 seconds

rateValue - total rate divider. See the formula of internal ticks above.
restartHours - restart captured spawner after this number of hours

Waypoint1,Waypoint2,Waypoint3 - add waypoints ([add Waypoint) and link with this props. If any of this waypoint not null the castle will spawn patrol groups (if kills at tick time equals 0, means castle not under attack)

Notes

For lag reducing purpose all monsters corpses(except boss monster) will deleted imideatly.

To remove castle and all spawn just type [remove and point to the castle spawn sign. If castle multi is not removed use [wipemultis to delete empty castle.

Warning !UO client cache multi in dat file. So after deletion of castle multi sometimes you can notice parts of castle artifacts. Just exit client and run it again.

History:
v0.66
* small fix again

v0.65
* small fixes on mobs, doors and base spawn script

v0.6
* reduced number of default setting for defender mobs to prevent client lags
* sounds on spawn disabled to prevent client lags
* mobs are now dont speak again to reduce lags
* mobs are stronger !
* small changes

v0.51
* fixed my stupid bug (possible divide by zero). Many thanks to yevusi for pay attention on this.

v0.5
* initial release
Attached Files
File Type: zip castleassault.zip (20.5 KB, 554 views)
x-ray is offline   Reply With Quote
Old 08-25-2004, 04:30 AM   #2 (permalink)
Newbie
 
Join Date: May 2004
Age: 35
Posts: 29
Default

looks like another cool script,

great work


well, haven't tested the scritp yet, but from looking over it, something looks a bit problematic to me:

Code:
float chance;

					if (from.StatCap == 0)
					{
						chance = ((float)from.Str) / ((float)from.StatCap);
					}
					else
					{
						chance = 0.2f;
					}
isn't there a problem in the first condition ?
because if from.StatCap equals 0 you don't want to devide something by it.
yevusi is offline   Reply With Quote
Old 08-25-2004, 07:14 AM   #3 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

This condition is the kind of insurence to prevent divide by zero.
The chance of door break calculated by following formula:

chance = char str / statcap.

This is it.
If character have statcap == 0 i just use hardcoded chance 0.2, about 20% to successfully break the door. Thats all and no problem here
x-ray is offline   Reply With Quote
Old 08-25-2004, 08:06 AM   #4 (permalink)
Newbie
 
Join Date: May 2004
Age: 35
Posts: 29
Default

yea, x-ray i understand that, but you got the order wrong

if you look closely you see the following logic :

if StatCap == 0
divide by StatCap (=0)
else
set to 0.2


it should be :

if statCap == 0
set to 0.2
else
divide by StatCap
yevusi is offline   Reply With Quote
Old 08-25-2004, 08:09 AM   #5 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Arrrrrrrrrrrrrrrrgh
sorry - its 1-26am here and i am wrong - this is my mistake

Sure - change the '==' to '!='

I will change and repost script...
x-ray is offline   Reply With Quote
Old 08-25-2004, 08:13 AM   #6 (permalink)
Newbie
 
Join Date: May 2004
Age: 35
Posts: 29
Default

x-ray, this is why we are here

i call this symptom- "the man from the side debugging"
when you work on your code, your view get fixed on some parts, and you don't notice the obvious things, but somone who has a fresh look on the code can spot it in seconds....

we all suffer from it
yevusi is offline   Reply With Quote
Old 08-25-2004, 08:20 AM   #7 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Quote:
Originally Posted by yevusi
x-ray, this is why we are here

i call this symptom- "the man from the side debugging"
when you work on your code, your view get fixed on some parts, and you don't notice the obvious things, but somone who has a fresh look on the code can spot it in seconds....

we all suffer from it
Version 0.51 reposted

I just change it to this

Code:
if (from.StatCap > 0)
{
chance = ((float)from.Str) / ((float)from.StatCap);
to prevent even impossible things

And all you said above is true I work this script for about 4-6 hours long today - this drives me a little nut
Again, thanks for pointing me
x-ray is offline   Reply With Quote
Old 08-25-2004, 02:19 PM   #8 (permalink)
Newbie
 
Join Date: Aug 2004
Posts: 27
Send a message via AIM to XMalachiX
Question Question!

Yo, i kno this is off topic, but is this script for runuo 1.0 or 36? plz answer thx!
XMalachiX is offline   Reply With Quote
Old 08-25-2004, 02:34 PM   #9 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 41
Posts: 3,259
Default

Quote:
Originally Posted by XMalachiX
Yo, i kno this is off topic, but is this script for runuo 1.0 or 36? plz answer thx!
All current released scripts should be for 1.0 as thats all thats supported
Tru is offline   Reply With Quote
Old 08-25-2004, 02:44 PM   #10 (permalink)
Forum Novice
 
brodock's Avatar
 
Join Date: Jan 2003
Location: Florianópolis, SC - Brazil
Age: 22
Posts: 579
Default

runuo 36 is a looooooooooooooooooooooooooong time no more supported... obvious you can test it, but if it doesn't work... it will be hard to get support (Feeling like Phantom answering this... lol)
__________________
UO Central: O Mistério do Oculto
(Free Shard Brasileiro)

brodock is offline   Reply With Quote
Old 08-25-2004, 03:49 PM   #11 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Quote:
Originally Posted by XMalachiX
Yo, i kno this is off topic, but is this script for runuo 1.0 or 36? plz answer thx!
I run and test it on Runuo 1.0rc0.
As everyone said above you can try to test it on beta36, but i am not sure will this work or not...
x-ray is offline   Reply With Quote
Old 08-25-2004, 04:07 PM   #12 (permalink)
Newbie
 
Join Date: Aug 2004
Posts: 27
Send a message via AIM to XMalachiX
Default ok

ok thx :-/ just that im runnin 36 heh, but thx! i'll try it.
XMalachiX is offline   Reply With Quote
Old 08-25-2004, 04:31 PM   #13 (permalink)
Forum Novice
 
brodock's Avatar
 
Join Date: Jan 2003
Location: Florianópolis, SC - Brazil
Age: 22
Posts: 579
Question

-OFF TOPIC-
just wandering why you run in beta 36 (i saw phantom talking about that in other thread but didn't saw why... lol )

is it in someway related with a "shard pack you downloaded" or a "modified" runuo.exe someone decompiled?
__________________
UO Central: O Mistério do Oculto
(Free Shard Brasileiro)

brodock is offline   Reply With Quote
Old 08-25-2004, 04:33 PM   #14 (permalink)
Newbie
 
Join Date: Aug 2004
Posts: 27
Send a message via AIM to XMalachiX
Default

Quote:
Originally Posted by brodockbr
-OFF TOPIC-
just wandering why you run in beta 36 (i saw phantom talking about that in other thread but didn't saw why... lol )

is it in someway related with a "shard pack you downloaded" or a "modified" runuo.exe someone decompiled?
Heh, im runing 36 'cause im the co-owner of the shard, but the owner dont want to use 1.0 (cause of bugs?) well theres your answer.
XMalachiX is offline   Reply With Quote
Old 08-25-2004, 07:12 PM   #15 (permalink)
Forum Novice
 
Join Date: Jul 2004
Age: 42
Posts: 166
Smile nice script but...

Hello,

Nice script, but they spawn a huge amount of orcs, is there a way to lower the spawn based on the size of the group coming to do the encounter?

thanks

deryk
darkoverlord is offline   Reply With Quote
Old 08-25-2004, 07:30 PM   #16 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Quote:
Originally Posted by darkoverlord
Hello,

Nice script, but they spawn a huge amount of orcs, is there a way to lower the spawn based on the size of the group coming to do the encounter?

thanks

deryk
You can only lower number of members in each group by double clicking the spawner sign.
You can not alter defenders spawn points or number of groups. But i think lowering number of members will be enough.

BTW the default full (maximum number of defenders in castle without boss) spawn is:
4*6 groups = 24 archers
2*11 groups = 22 mages
3*7 groups = 21 warriors
total = 67 mobs, this even smaller amount than first champion spawn waves

Are you experinced any problems with this values ? Dont forget, players never get into the middle of castle with this values So i think when they break a number of doors the number of defenders will be even < 67

BTW 2ALL:
Please, let me know about balancing and the optimal config values(in your oppinion) you used to configure the spawn. Also please mention the skillcap and statcap on your shard. Will be appreciate for this. Thanks.
x-ray is offline   Reply With Quote
Old 08-27-2004, 10:58 PM   #17 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Quote:
BTW 2ALL:
Please, let me know about balancing and the optimal config values(in your oppinion) you used to configure the spawn. Also please mention the skillcap and statcap on your shard. Will be appreciate for this. Thanks.
One hundred of downloads and no one reply Pity...
x-ray is offline   Reply With Quote
Old 08-28-2004, 03:36 PM   #18 (permalink)
Newbie
 
Join Date: Feb 2003
Location: Toronto, Ontario
Age: 22
Posts: 98
Send a message via AIM to Aidsteen Send a message via MSN to Aidsteen Send a message via Yahoo to Aidsteen
Default

What would I need to add so that when players finish, the castle gets destroyed? Sort of like..

*boss dies*
"As the boss falls, the castle crumbles around you."
*delete the multi and sign thingy*

?
Aidsteen is offline   Reply With Quote
Old 08-28-2004, 09:29 PM   #19 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

You dont need to add anything. If the boss dies the castle stop spawning monsters and patrols and restart after RestartHours propertie.

ps I plan to reduce number of default spawn of defenders and make the defenders little stronger... Stay tuned...
x-ray is offline   Reply With Quote
Old 08-28-2004, 11:23 PM   #20 (permalink)
Newbie
 
Join Date: Feb 2003
Location: Toronto, Ontario
Age: 22
Posts: 98
Send a message via AIM to Aidsteen Send a message via MSN to Aidsteen Send a message via Yahoo to Aidsteen
Default

Well, do the doors remain unlocked? That was the only real issue I had with it.
Aidsteen is offline   Reply With Quote
Old 08-29-2004, 04:48 PM   #21 (permalink)
Newbie
 
Join Date: Jun 2004
Age: 21
Posts: 83
Default

With this how would you just add the door with a command? I have tride a few but it says rong format.
Styxx is offline   Reply With Quote
Old 08-29-2004, 07:34 PM   #22 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Quote:
Originally Posted by Aidsteen
Well, do the doors remain unlocked? That was the only real issue I had with it.
If boss monster alive and autorepair in props is true the doors "autorepairs" and after completly repair is locked. If autorepair is false the doors will remain unlocked.
If the boss monster die the doors stop autirepair until restart time. At restart time all doors is 'reset' and locked...

Quote:
With this how would you just add the door with a command? I have tride a few but it says rong format
You mean you want add new door to the castle ? You can use [add command to add EvilCastleMetalDoor but i think this is bad idea. The castle "track" only native doord. The door you add wont autorepair and wont "reset" after restart time...
x-ray is offline   Reply With Quote
Old 08-29-2004, 08:44 PM   #23 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 30
Posts: 152
Default

Version 0.6 reposted.

* reduced number of default settings for defender mobs to prevent client lags
* sounds on spawn disabled to prevent client lags
* mobs are now dont speak again to reduce lags
* mobs are stronger !
* small changes
x-ray is offline   Reply With Quote
Old 08-29-2004, 08:58 PM   #24 (permalink)
Lurker
 
Join Date: Aug 2003
Posts: 6
Default Cool.

Nice script I will shurely use it on my shard.
Blackacid is offline   Reply With Quote
Old 08-29-2004, 10:02 PM   #25 (permalink)
Newbie
 
Join Date: Jun 2004
Age: 21
Posts: 83
Default

Quote:
Originally Posted by x-ray
You mean you want add new door to the castle ? You can use [add command to add EvilCastleMetalDoor but i think this is bad idea. The castle "track" only native doord. The door you add wont autorepair and wont "reset" after restart time...
When I added the door, server crashed after testing it with a player character. Here is the server report.

Code:
Server Crash Report
===================

Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 24/12/2002 10:14:42 PM
Mobiles: 2974
Items: 52694
Clients:
- Count: 1

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Items.EvilCastleMetalDoor.Use(Mobile from)
   at Server.Items.BaseDoor.OnDoubleClick(Mobile from)
   at Server.Mobile.Use(Item item)
   at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
Would there be anyway to be able to make it work?
Styxx is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5