QUOTE |
<Spawns> <Points> <Name>MoongateSwitch#1</Name> <UniqueId>6d281581-afb8-4687-a7e2-fc50d39108e4</UniqueId> <Map>Felucca</Map> <X>5436</X> <Y>1157</Y> <Width>0</Width> <Height>0</Height> <CentreX>5436</CentreX> <CentreY>1157</CentreY> <CentreZ>0</CentreZ> <Range>5</Range> <MaxCount>1</MaxCount> <MinDelay>5</MinDelay> <MaxDelay>10</MaxDelay> <DelayInSec>False</DelayInSec> <Duration>0</Duration> <DespawnTime>0</DespawnTime> <ProximityRange>-1</ProximityRange> <ProximityTriggerSound>500</ProximityTriggerSound> <TriggerProbability>1</TriggerProbability> <InContainer>False</InContainer> <MinRefractory>0</MinRefractory> <MaxRefractory>0</MaxRefractory> <TODStart>0</TODStart> <TODEnd>0</TODEnd> <TODMode>0</TODMode> <KillReset>1</KillReset> <ExternalTriggering>False</ExternalTriggering> <SequentialSpawning>-1</SequentialSpawning> <AllowGhostTriggering>False</AllowGhostTriggering> <SpawnOnTrigger>False</SpawnOnTrigger> <SmartSpawning>False</SmartSpawning> <Team>0</Team> <Amount>1</Amount> <IsGroup>False</IsGroup> <IsRunning>True</IsRunning> <IsHomeRangeRelative>True</IsHomeRangeRelative> <Objects2>timedswitchableitem/name/Moongate Switch/mindelay/00:00:20/maxdelay/00:00:20/itemid0/3796/itemid1/1/target1item/GET,MoongateSwitch#2,xmlspawner,serial/target1property/@/proximityactivated/true:MX=1:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2> </Points> <Points> <Name>MoongateSwitch#2</Name> <UniqueId>7a72a1a5-2445-426f-b858-73d2b719bbdd</UniqueId> <Map>Felucca</Map> <X>5436</X> <Y>1156</Y> <Width>0</Width> <Height>0</Height> <CentreX>5436</CentreX> <CentreY>1156</CentreY> <CentreZ>0</CentreZ> <Range>5</Range> <MaxCount>1</MaxCount> <MinDelay>5</MinDelay> <MaxDelay>10</MaxDelay> <DelayInSec>False</DelayInSec> <Duration>0.316666666666667</Duration> <DespawnTime>0</DespawnTime> <ProximityRange>-2</ProximityRange> <ProximityTriggerSound>500</ProximityTriggerSound> <TriggerProbability>1</TriggerProbability> <InContainer>False</InContainer> <MinRefractory>0</MinRefractory> <MaxRefractory>0</MaxRefractory> <TODStart>0</TODStart> <TODEnd>0</TODEnd> <TODMode>0</TODMode> <KillReset>1</KillReset> <ExternalTriggering>False</ExternalTriggering> <SequentialSpawning>-1</SequentialSpawning> <AllowGhostTriggering>False</AllowGhostTriggering> <SpawnOnTrigger>True</SpawnOnTrigger> <SmartSpawning>False</SmartSpawning> <Team>0</Team> <Amount>1</Amount> <IsGroup>False</IsGroup> <IsRunning>True</IsRunning> <IsHomeRangeRelative>True</IsHomeRangeRelative> <Objects2>moongate/target/(5439,1150,0)/targetmap/felucca:MX=1:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2> </Points> </Spawns> |
QUOTE |
- added the new "DELETE" keyword that can be used to modify a standalone keyword and delete the object that it refers to (it will not allow you to delete players) For example, this spawn entry SET,Mystic Sword,longsword/DELETE will delete the longsword named "Mystic Sword" SETONMOB,SeeYouLater,Balron/DELETE will delete the balron named "SeeYouLater" SETONCARRIED,,Gold/DELETE will delete gold that it finds being carried by the triggering mob SETONSPAWN,TargetSpawner,2/DELETE will delete all of the spawns of subgroup 2 on the spawner named TargetSpawner. This is basically the same as using the DESPAWN keyword but will delete all spawns regardless of their CLR flag setting. |
QUOTE |
timedswitchableitem/name/Moongate Switch/mindelay/0/maxdelay/0/itemid0/3796/itemid1/1/target1item/GET,MoongateSwitch#2,xmlspawner,serial/target1property/@/proximityactivated/true SETONSPAWN,1/target0item/GETONSPAWN,1,serial/target0property/@/DELETE |
QUOTE |
timedswitchableitem/name/Moongate Switch/mindelay/0/maxdelay/0/itemid0/3796/itemid1/1/target1item/GET,MoongateSwitch#2,xmlspawner,serial/target1property/@/proximityactivated/true SETONSPAWN,1/target0item/GETONSPAWN,1,serial/target0property/@/DELETE |
CODE |
using System; using Server; namespace Server.Items { public class SingleUseSwitch : SimpleSwitch { [Constructable] public SingleUseSwitch() { } public SingleUseSwitch(Serial serial) : base(serial) { } public override void OnDoubleClick(Mobile from) { if (from == null || Disabled) return; if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) { from.SendLocalizedMessage(500446); // That is too far away. return; } base.OnDoubleClick(from); // delete after use Delete(); } public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write((int)0); // version } public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); } } } |
QUOTE |
orc/ADD/<singleuseswitch/name/Moongate Switch/itemid/3796/movable/true/target1item/GET,MoongateSwitch#2,xmlspawner,serial/target1property/@/proximityactivated/true |
QUOTE |
orc/ADD/<singleuseswitch/name/Moongate Switch/itemid/3796/movable/true/ATTACH/temporaryquestobject,,30/target1item/GET,MoongateSwitch#2,xmlspawner,serial/target1property/@/proximityactivated/true |
QUOTE (slida @ April 10, 2006 08:49 pm) |
Allright! Everythings a go! It would have been a lot quicker if I had noticed that your How Do I forum had more than page(the search option here doesn't do much, you have to just look around, for instance, I typed in switch and all I got was this post and some other post that just had the word switch in it, maybe it doesn't search all the forums like it says it is). Thanks for the script, it works great, and it's so simple, I'm slowly remembering how OOP works. It's the perfect language for doing a game like this, and it is a great way to learn it actually. Someone should develop a language tutorial using UO. I have a couple of observations about the program. Although it certainly adds graphical elegance to the GUI, I don't like using the books, they do some odd things with the text and make weird line breaks, it can be difficult to notice mistakes, is there a simple way for me to modify that to just a text box? The second thing is probably unfixable, but It took me a while to figure out what I was doing wrong because, unless I flat out misspelled a command, when an error popped up, it would just show the last error, I kept thinking everything was fine but the last part of the code, when really I had screwed up much earlier. I figure that is probably just an inherent limitation though. Thanks a lot for your help, I get a bit obsessive/compulsive when it comes to problem solving and I was unable to continue with my quest until I got this figured out. I'll try to keep my questions to a minimum, but it's almost guaranteed I'll want to do something crazy in the future. Can't wait to start screwing around with xmlattachments especially. This is quite a system you have here, I think if more people realized what it could do it would be even more popular. Keep up the good work! I'll make some contributions to the cause when I know enough to be helpful. |