CODE |
// first check to see if you are too far from the return container. This is to avoid exploits involving targeting a container // then using the return reward feature as a free transport of items back to that container if(m_QuestItem.ReturnContainer != null && !m_QuestItem.ReturnContainer.Deleted) { Point3D returnloc; if(m_QuestItem.ReturnContainer.Parent == null) { returnloc = m_QuestItem.ReturnContainer.Location; } else if(m_QuestItem.ReturnContainer.RootParent != null) { returnloc = ((IEntity)m_QuestItem.ReturnContainer.RootParent).Location; } else { from.SendMessage("Invalid container location"); return; } if(!Utility.InRange( returnloc, from.Location, 10)) { // out of range from.SendMessage("Too far away from the reward return container"); return; } } |