Page 1 of 1

Some Custom Commands

PostPosted: Sat Mar 05, 2011 7:52 am
by Yemla
  • 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

Re: Some Custom Commands

PostPosted: Sat Mar 05, 2011 12:25 pm
by Graveen
This Yem' ! ;)

Re: Some Custom Commands

PostPosted: Sat Mar 05, 2011 10:12 pm
by Yemla
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

Re: Some Custom Commands

PostPosted: Tue Mar 08, 2011 12:50 pm
by Dunnerholl

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

Re: Some Custom Commands

PostPosted: Tue Mar 08, 2011 8:42 pm
by Graveen
SplitCSV() method, in the core, can help you.

Re: Some Custom Commands

PostPosted: Wed Mar 09, 2011 1:34 am
by Argo
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.
;)