Detecting/celaring harmful effects

RS47

Active Member
Hi everyone, I am considering to write a script that would detect when I get poisoned/diseased/cursed by specific spells and uses the appropriate action to clear the harmful effect.

Example: if I am affected by, for instance, bite of nagsuul, the debuff and duration is showed in the harmful effect section of my UI (therefore the client "knows" I am under the influence of that poison). Ideally, the script would perform a check of my debuffs every x pulses and, upon detection of one of the harmful effects listed would perform the appropriate action.

This would be insanely useful against some mobs that cast pretty nasty spells that can be cured, but can quickly kill you if you don't notice in time.

Now the questions, for those who know about scripting:
1)has something like this been written already? If so, I'd appreciate a link..
2)Do you think it is doable? I would think so, but it sounds so useful that I was surprised to see I couldn't find a script like this aronud.

Also.. I never did anything like this before, and I don't know much about scripting. I checked out the wiki (and the lavish wiki) and I decided to start studying and see if I could figure out how to start, motivated by posts of people who didn't know much of programming/scriping yet managed to learn.. anyone has any useful links with tutorials, or maybe some simple scripts I could use to "analyze" and learn from?

Thanks in advance for any help and advice you can give, I am a total rookie but I am willing to do my best to learn :)
 

mmoaddict

Original Script Author: VGA
well you will have to do a couple of things

First you will need to make an interface that allows you to put in the name of the item you want to remove and save that list to an xml file. Then you want the game to constantly check you for that debuff... For instance.. i wrote up a similar thing to strip mobs of enchantments... There is more to it than this code but hopefully it will get you going..

first the GUI
;********************************************
/* Add item to the Dispell list */
;********************************************
atom(global) AddDispellSpell(string aName)
{
if ( ${aName.Length} > 1 )
{
DispellSpells:AddSetting[${aName}, ${aName}]
}
else
{
return
}
}
atom(global) RemoveDispellSpell(string aName)
{
if ( ${aName.Length} > 1 )
{
DispellSpells.FindSetting[${aName}]:Remove
}
else
{
}
}

atom(global) BuildDispellList()
{
echo building Dispell List
variable iterator Iterator
DispellSpells:GetSettingIterator[Iterator]
UIElement[DispellList@MainCasterFrame@MainCaster@SubCaster@CasterFrame@Caster@ABot@vgassist]:ClearItems
while ( ${Iterator.Key(exists)} )
{
UIElement[DispellList@MainCasterFrame@MainCaster@SubCaster@CasterFrame@Caster@ABot@vgassist]:AddItem[${Iterator.Key}]
Iterator:Next
}
}

Second... Look for it on the mobs

;********************************************
function dispellfunct()
{

if ${DispellSelected}
{
variable iterator Iterator
DispellSpells:GetSettingIterator[Iterator]
while ( ${Iterator.Key(exists)} )
{
if ${Me.TargetBuff[${Iterator.Key}](exists)}
{
echo "OMG Dispell ${Iterator.Key}"
if ${Me.Ability[${dispell1}].IsReady}
{
Me.Ability[${dispell1}]:Use
call MeCasting
}
}
Iterator:Next
}
}

}
 

RS47

Active Member
Thanks a lot!!

As I mentioned in my post I am a total rookie so any small script helps me a lot, especially something which does something similar to the one I have in mind.. If anybody else has any snippets or tips feel free to post them and thanks in advance :)
 

Zandros

Script Author: VGA
This is purely from scratch and I do not know if it works or not. But you should get an idea how to scan for detrimental effects and if one is present then cast your debuff spell.

The routine returns TRUE if it removed an harmful effect. False if the debuff spell is not ready or there are no harmful effects.

PS - I always put a "wait 3" after any ability I use to give the system time to register spell casting or cooldowns.

Code:
function:bool RemoveHarmfulEffect()
{
	if !${Me.Ability[${debuff}].IsReady}
	{
		return FALSE
	}

	variable int a

	for (a:Set[1]; ${a}<${Me.Effect.Count} ; a:Inc)
	{
		if ${Me.Effect[${a}].IsDetrimental}
		{
			Me.Ability[${debuff}]:Use
			wait 3
			call MeCasting
			return TRUE
		}	
	}
	return FALSE
}
 
Top Bottom