Is there a turorial i can start to look at that would help out with using the spawner for a teleporter that is account sentisive. Example: If it is the first char on an account they would go to Location A. If it was any others then they would go to Location B.
Thanks.
if you make this mod in playermobile.cs, you can get the index of the player in the account list and use it in a condition test in the spawner.
around line 100 in playermobile.cs
QUOTE |
private int m_GuildMessageHue, m_AllianceMessageHue;
[CommandProperty(AccessLevel.Counselor, AccessLevel.Owner)] public new Account Account { get { return base.Account as Account; } set { base.Account = value; } }
// ARTEGORDONMOD // return the players index in the account list public int AccountIndex { get { Account acct = Account as Account; if (acct != null) { for (int i = 0; i < acct.Length; i++) { if (this == acct[i]) return i; } } return -1; } }
|
and then in your triggered spawner add entries like
#CONDITION,GETONTRIGMOB,accountindex>0 ; SETONTRIGMOB/location/(1000,1500,0)/map/felucca
#CONDITION,GETONTRIGMOB,accountindex=0 ; SETONTRIGMOB/location/(1500,1200,0)/map/trammel
and put the two into the same subgroup so that they are both spawned when the spawner triggers, but which one is activated will depend on the outcome of the #CONDITION test.
I looking but havnt found
CODE |
private int m_GuildMessageHue, m_AllianceMessageHue;
[CommandProperty(AccessLevel.Counselor, AccessLevel.Owner)] public new Account Account { get { return base.Account as Account; } set { base.Account = value; } } |
Is that from RunUO 2.0?
I just looked it is. The shard is still RunUO 1.0
Thanks for helping with this.
yeah, that was from 2.0, but the mod is the same for 1.0. You dont actually have to put it in that exact spot, I just used that as an example. You can put it here, for example
QUOTE |
[CommandProperty(AccessLevel.GameMaster)] public int Profession { get { return m_Profession; } set { m_Profession = value; } }
// ARTEGORDONMOD // return the players index in the account list public int AccountIndex { get { Account acct = Account as Account; if (acct != null) { for (int i = 0; i < acct.Length; i++) { if (this == acct[i]) return i; } } return -1; } }
|
Ok i have the Mod in Playmobile.cs and a spawner with the entrys you posted. It hasnt worked for me yet but Im not sure if I have the spawner set right.
Modified:
Group = True
MaxDelay = 00.00
MinDelay = 00.00
ProximityRange = 0
SpawnOnTrigger = True
SpawnRange = 0
I was attempting to get it so when they walk over it they get teleported. Nothing else required.
I would
1) set Group to false (that tells it to only respawn when the spawner is empty). It probably wont matter in this case, but it isnt needed.
2) make sure that your two entries are in the same subgroup.
3) make sure you are testing it as a player.
4) Also, with SpawnOnTrigger set to true, you dont need to set Min/MaxDelay to zero. It will still work, but it is unnecessary. I would only do that if you wanted the spawner to make frequent checks for non-moving triggering mobs.
5) make sure that you have a version of xmlspawner that supports the #CONDITION keyword (at least version 3.10). Check this with the "[smartstat" command.
I just tried out the spawner below and it worked. Just put it into a file and do an "[xmlloadhere filename". When you walk over it, you will be tele'd (I picked random locs, so it might put you in black).
QUOTE |
<Spawns> <Points> <Name>AccountTeleport</Name> <UniqueId>6da30829-04f5-4fb8-b42d-e54feb619e3f</UniqueId> <Map>Felucca</Map> <X>5425</X> <Y>1140</Y> <Width>10</Width> <Height>10</Height> <CentreX>5430</CentreX> <CentreY>1145</CentreY> <CentreZ>0</CentreZ> <Range>5</Range> <MaxCount>2</MaxCount> <MinDelay>5</MinDelay> <MaxDelay>10</MaxDelay> <DelayInSec>False</DelayInSec> <Duration>0</Duration> <DespawnTime>0</DespawnTime> <ProximityRange>0</ProximityRange> <ProximityTriggerSound>500</ProximityTriggerSound> <ProximityTriggerMessage>goodbye</ProximityTriggerMessage> <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> <AllowNPCTriggering>False</AllowNPCTriggering> <SpawnOnTrigger>True</SpawnOnTrigger> <SmartSpawning>False</SmartSpawning> <Team>0</Team> <Amount>1</Amount> <IsGroup>False</IsGroup> <IsRunning>True</IsRunning> <IsHomeRangeRelative>True</IsHomeRangeRelative> <Objects2>#CONDITION,GETONTRIGMOB,accountindex>0 ; SETONTRIGMOB/location/(1000,1500,0)/map/felucca:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=#CONDITION,GETONTRIGMOB,accountindex=0 ; SETONTRIGMOB/location/(1500,1200,0)/map/trammel:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2> </Points> </Spawns>
|
Using what you posted and loading the file worked. I looked at the spawner and see what I was doing wrong now. ( My head Seer does most of the XMLSpawner work for the shard ) When you said put them under the same subclass i was putting them under the same entry. I should have tested that. Thank you very much. I swear almost nothing is impossible with this spawner.