Some Custom Commands

Share files with other Dawn of Light users

Moderator: Support Team

Some Custom Commands

Postby Yemla » Sat Mar 05, 2011 7:52 am

  • 1. Pet Buff - This buffs a target controlled NPC(Default will buff your main pet) when out of combat, currently using it where the player tech. cast instantly the buffs on the pet. Can make it where the pet casts it but none the less it works. You may modify the buffs easy to make it , has a 60sec reuse (recommended so it cant be spammed). Added a special Magic only damage debuff that is currently set to reduce 75% of the magic damage done to the pet.

    2. Repair Gear - This repairs and recharges all current equipped items. sets all charges to 1000...sets quality item to 100 and other things but can be easily modified.
These 2 aren't checked for updated SVN, but none the less are pretty easy to updated if needed, i found no errors...but never know ingame issues or not...

This one is tricky...i call it gamenpc modifier(not to mention was never fully tested)...basically its all temporary things, atleast that i've known...Basically this is what it does...
Code: Select all
"/Gamenpc <spell> <spellID> <self|enemy|npcguild|npcname>",
"/Gamenpc <add|remove> <ability|base|spec|debuff> <property> <value> <radius>")]
Spell = Spell you want to cast, like Phaseshift on all NPCs with that name, they will cast it (targetted npc name) this command has not been tested on updated SVN

SpellHandler Under Group at line 2298 is where i put this
Code: Select all
#region NPCGUILD
case "npcguild":
{
GameNPC npc = (GameNPC)m_caster;
int spellRange = CalculateSpellRange();
if (spellRange == 0)
spellRange = NewRadius;

//Just add ourself
if (npc.GuildName == "")
{
list.Add(m_caster);

IControlledBrain npcPet = npc.ControlledBrain;
if (npcPet != null)
{
//Add our first pet
GameNPC petBody2 = npcPet.Body;
if (npc.IsWithinRadius(petBody2, spellRange))
list.Add(petBody2);

//Now lets add any subpets!
if (petBody2 != null && petBody2.ControlledNpcList != null)
{
foreach (IControlledBrain icb in petBody2.ControlledNpcList)
{
if (icb != null && m_caster.IsWithinRadius(icb.Body, spellRange))
list.Add(icb.Body);
}
}
}

}
//We need to add the entire group
else
{
foreach (GameNPC npcs in npc.GetNPCsInRadius((ushort)spellRange))
{
// only players in range
if (npcs.GuildName == npc.GuildName)
{
list.Add(npcs);

IControlledBrain npcPet = npcs.ControlledBrain;
if (npcPet != null)
{
//Add our first pet
GameNPC petBody2 = npcPet.Body;
if (npc.IsWithinRadius(petBody2, spellRange))
list.Add(petBody2);

//Now lets add any subpets!
if (petBody2 != null && petBody2.ControlledNpcList != null)
{
foreach (IControlledBrain icb in petBody2.ControlledNpcList)
{
if (icb != null && m_caster.IsWithinRadius(icb.Body, spellRange))
list.Add(icb.Body);
}
}
}
}
}
}

break;
}
#endregion
#region NPCNAME
case "npcname":
{
GameNPC npc = (GameNPC)m_caster;
int spellRange = CalculateSpellRange();
if (spellRange == 0)
spellRange = NewRadius;
foreach (GameNPC npcs in npc.GetNPCsInRadius((ushort)spellRange))
{
// only players in range
if (npcs.Name == npc.Name)
{
list.Add(npcs);

IControlledBrain npcPet = npcs.ControlledBrain;
if (npcPet != null)
{
//Add our first pet
GameNPC petBody2 = npcPet.Body;
if (npc.IsWithinRadius(petBody2, spellRange))
list.Add(petBody2);

//Now lets add any subpets!
if (petBody2 != null && petBody2.ControlledNpcList != null)
{
foreach (IControlledBrain icb in petBody2.ControlledNpcList)
{
if (icb != null && m_caster.IsWithinRadius(icb.Body, spellRange))
list.Add(icb.Body);
}
}
}
}
}
}
break;
#endregion

again use if you want or not idc, was just some fun stuff i made back in the day
Attachments
RepairGear.cs
(3.48 KiB) Downloaded 280 times
GameNPC.cs
(10.86 KiB) Downloaded 350 times
Petbuff.cs
(19.78 KiB) Downloaded 341 times
Yemla
Contributor
 
Posts: 215
Joined: Sat Feb 02, 2008 3:21 am
Website: http://www.facebook.com/J.D.Snelling
Location: California

Re: Some Custom Commands

Postby Graveen » Sat Mar 05, 2011 12:25 pm

This Yem' ! ;)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Some Custom Commands

Postby Yemla » Sat Mar 05, 2011 10:12 pm

I've got somemore coming, just gotta work on them

1 is going to be adding updates to NPCTemplates in game (like evade, parry, block chance, spells, styles, ect. =]...)


example being
  • "/specialbuff <add> <TemplateID> <Spell | Style> <ID>",
    "/specialbuff <remove> <TemplateID> <Spell | Style> <all>"
if anyone knows how to remove a string from a string without removing the whole thing please let me know

Spells = 32323;300 and i want to remove 32323 = args[3] + ";"; but idk how exactly =x

EDIT:
Code: Select all
DBNpcTemplate tmp = GameServer.Database.FindObjectByKey<DBNpcTemplate>(args[2]);
if (tmp.Spells.Contains(args[3] + ";"))
{
tmp.Spells.Replace(args[3] + ";", "");
}
else if (tmp.Spells.Contains(args[3]))
{
tmp.Spells.Replace(args[3], "");
}
possibly? i feel dumbfounded
Yemla
Contributor
 
Posts: 215
Joined: Sat Feb 02, 2008 3:21 am
Website: http://www.facebook.com/J.D.Snelling
Location: California

Re: Some Custom Commands

Postby Dunnerholl » Tue Mar 08, 2011 12:50 pm


Spells = 32323;300 and i want to remove 32323 = args[3] + ";"; but idk how exactly =x

d
do you want to remove something known or the part before the ; or including ; or what?

try to be more exact in writing what you want - and remove that signature, please

generally, substring could work or regexp
Dunnerholl
Developer
 
Posts: 1229
Joined: Mon Sep 08, 2008 8:39 pm

Re: Some Custom Commands

Postby Graveen » Tue Mar 08, 2011 8:42 pm

SplitCSV() method, in the core, can help you.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Some Custom Commands

Postby Argo » Wed Mar 09, 2011 1:34 am

SplitCSV() method, in the core, can help you.
An awesome thing this SplitCSV() Method, even the Instances and their weapon wearing inhabitants love it now.
;)
Möge Gott sein zwischen Dir und dem Leid, an allen dunklen und verlassenen Orten, die Du erreichen wirst.
Argo
Server Team
 
Posts: 1760
Joined: Thu Sep 18, 2008 6:21 pm
Location: Berlin, Germany


Return to “%s” User Files

Who is online

Users browsing this forum: No registered users and 1 guest