Just for a coding matters :
- Code: Select all
player.Out.SendMessage("You gain " + reward + " Bountypoints from " + this.Name, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
You should use string format here,
- Code: Select all
player.Out.SendMessage(string.Format("You gain {0} Bountypoints from {1}", reward, this.Name), eChatType.CT_Important, eChatLoc.CL_SystemWindow);
It will improve the performance/memory usage, and it match some other use case such as "Translations" that use similar Formatting.
----
You're also calling multiple time "this.RemoveFromWorld();" for each of the "Name case", and one last time at the end of the method...
And you have an empty loop on "foreach (GamePlayer p in this.GetPlayersInRadius(250))", Get*InRadius methods are pretty expensive, and shouldn't be used for doing nothing
----
And lastly not about code, DataQuest are already able to handle this use case...
there is a Start Type :
InteractComplete = 4, // Interacting with start object grants and finishes the quest
And you can customize the reward
RewardBP - Serialized list of XP rewarded each step. All steps must have a value, 0 is ok.
finally allow unlimited quest accomplishment (or not...)
MaxCount, MinLevel, MaxLevel - Single values to determine who can do quest. All must be provided. MaxCount == 0 for no limit
http://www.dolserver.net/articles/?article=48