Page 1 of 1

Region IDs in Cases

PostPosted: Sun Jun 12, 2011 7:28 am
by Hiatus
I currently use this for creating a marker in game (from a mob) that's why the getName is there. Can be modified greatly to do other things :)

Enjoy

Re: Region IDs in Cases

PostPosted: Sun Jun 12, 2011 10:50 am
by Etaew
couldn't you just loop through the zones and regions loaded into memory and compare ID with WorldMgr instead of a switch? or a getByID method call.

Re: Region IDs in Cases

PostPosted: Sun Jun 12, 2011 1:31 pm
by Hiatus
I use it for creating a certain marker mob in-game, it just creates the mob with where ever the region is with that specific region name, that's why I did getName and some other things.

Code: Select all


// this is in the AddToWorld method
if (this.GuildName.Length == 0)
{ this.GuildName = IDtoName.getName(this.CurrentZone.ID); }


public override string GuildName
{
get
{
return base.GuildName;
}
set
{

base.GuildName = value;
}
}
}

Re: Region IDs in Cases

PostPosted: Sun Jun 12, 2011 5:44 pm
by Graveen
Sorry Hiatus, what is exactly a 'marker' ?

Re: Region IDs in Cases

PostPosted: Sun Jun 12, 2011 7:23 pm
by Hiatus
its for something like foreach(GameNpc npc in WorldMgr.GetAllNPCsByGuild()

etc just finding the npc in the certain location, can be used for various amounts of things, this script can also be altered heavily to fit whatever tasks needed

Re: Region IDs in Cases

PostPosted: Thu Jun 16, 2011 11:43 pm
by Dinberg
Hiatus, I think this will upset you ;)
Code: Select all
string RegionToName = this.CurrentRegion.Description