Region IDs in Cases

Share files with other Dawn of Light users

Moderator: Support Team

Region IDs in Cases

Postby Hiatus » Sun Jun 12, 2011 7:28 am

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
Attachments
IDtoName.cs
(35.66 KiB) Downloaded 178 times
Graveen wrote:If you can't see the problem, then this is the problem :mrgreen:
User avatar
Hiatus
Support Team
 
Posts: 261
Joined: Sat Apr 30, 2011 3:54 pm

Re: Region IDs in Cases

Postby Etaew » Sun Jun 12, 2011 10:50 am

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.
Retired DOL Enthusiast | Blog
User avatar
Etaew
Inactive Staff Member
 
Posts: 7585
Joined: Mon Oct 13, 2003 5:04 pm
Location: England

Re: Region IDs in Cases

Postby Hiatus » Sun Jun 12, 2011 1:31 pm

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;
            }
        }
    }
Graveen wrote:If you can't see the problem, then this is the problem :mrgreen:
User avatar
Hiatus
Support Team
 
Posts: 261
Joined: Sat Apr 30, 2011 3:54 pm

Re: Region IDs in Cases

Postby Graveen » Sun Jun 12, 2011 5:44 pm

Sorry Hiatus, what is exactly a 'marker' ?
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 11962
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Region IDs in Cases

Postby Hiatus » Sun Jun 12, 2011 7:23 pm

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
Graveen wrote:If you can't see the problem, then this is the problem :mrgreen:
User avatar
Hiatus
Support Team
 
Posts: 261
Joined: Sat Apr 30, 2011 3:54 pm

Re: Region IDs in Cases

Postby Dinberg » Thu Jun 16, 2011 11:43 pm

Hiatus, I think this will upset you ;)

Code: Select all
string RegionToName = this.CurrentRegion.Description
One day, I will finish The Marvellous Contraption, in all its custom glory.
Decatur wrote:Ah neato stephen! I see I still have much to learn :)
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4557
Joined: Sat Mar 10, 2007 9:47 am
Location: Houses of Parliament


Return to User Files

Who is online

Users browsing this forum: No registered users and 1 guest