|
||
|
|
#1 (permalink) |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
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 |
|
|
|
|
|
#2 (permalink) |
|
Newbie
Join Date: May 2004
Age: 35
Posts: 29
|
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;
}
because if from.StatCap equals 0 you don't want to devide something by it. |
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
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 ![]() |
|
|
|
|
|
#4 (permalink) |
|
Newbie
Join Date: May 2004
Age: 35
Posts: 29
|
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 |
|
|
|
|
|
#6 (permalink) |
|
Newbie
Join Date: May 2004
Age: 35
Posts: 29
|
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 ![]() |
|
|
|
|
|
#7 (permalink) | |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
Quote:
I just change it to this Code:
if (from.StatCap > 0)
{
chance = ((float)from.Str) / ((float)from.StatCap);
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 ![]() |
|
|
|
|
|
|
#9 (permalink) | |
|
Forum Expert
Join Date: Jan 2003
Location: California
Age: 41
Posts: 3,259
|
Quote:
__________________
My Scripts: HoodableRobe CellarAddon SeigeUpdates Refresh/CloneMe Commands VooDoo Dolls Lost Alchemy SVN 187 Updates: Bard System + Upgrade Ultima VII |
|
|
|
|
|
|
#10 (permalink) |
|
Forum Novice
Join Date: Jan 2003
Location: Florianópolis, SC - Brazil
Age: 22
Posts: 579
|
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)
__________________
|
|
|
|
|
|
#11 (permalink) | |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
Quote:
As everyone said above you can try to test it on beta36, but i am not sure will this work or not... |
|
|
|
|
|
|
#13 (permalink) |
|
Forum Novice
Join Date: Jan 2003
Location: Florianópolis, SC - Brazil
Age: 22
Posts: 579
|
-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?
__________________
|
|
|
|
|
|
#14 (permalink) | |
|
Newbie
|
Quote:
![]() |
|
|
|
|
|
|
#16 (permalink) | |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
Quote:
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 < 67BTW 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. |
|
|
|
|
|
|
#17 (permalink) | |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
Quote:
Pity... |
|
|
|
|
|
|
#19 (permalink) |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
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... |
|
|
|
|
|
#22 (permalink) | ||
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
Quote:
If the boss monster die the doors stop autirepair until restart time. At restart time all doors is 'reset' and locked... Quote:
|
||
|
|
|
|
|
#23 (permalink) |
|
Forum Novice
Join Date: May 2004
Age: 30
Posts: 152
|
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 |
|
|
|
|
|
#25 (permalink) | |
|
Newbie
Join Date: Jun 2004
Age: 21
Posts: 83
|
Quote:
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) |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|