Sie sind auf Seite 1von 3

The script below is a spell cast by the player.

The spell causes lightning damag


e within a limited area of effect. An additional explosion (over an area of effe
ct) must be applied around each affected target.
However, the script is incomplete. Using the API (testAPI.txt file included) and
the existing script, please complete the DoExplode() function.
--------------------------------------------------------------------------------
--
--[[ Celest Faerie Spell
- Multiple targets; lightning strikes
- The Character will cast a lighting originating from it, and checking for a
target at 90 degree radius
- Then once the target is hit, it will do an explosion
- The base explosion range is 200 unit with a radius of 360 degrees
- Range will increase 1.5 X the base radius once the character's skill is at
level 6
- Range will increase 2 X the base radius once the character's skill is at l
evel 8
--]]

--------------------------------------------------------------------------------
--
-- DATA
--------------------------------------------------------------------------------
--
-- Constants
-- Base search for the player
local RANGE = 600;
local ANGLE = 90;
-- Used for the explosion
local RANGE_explo = 200;
local ANGLE_explo = 360;
local CLASS_ID = GetPyOID("ClassTable", "Spell_Lightning_1");
-- Cached values
local skill level;
local mana_cost;
local target;
local gameobject;
--------------------------------------------------------------------------------
--
-- EVENTS
--------------------------------------------------------------------------------
--
local function DoExplode(target)
/\
||
||
||
||
||
||
||
||
THIS IS WHERE THE SCRIPT WOULD GO BUT I DONT KNOW HOW TO SOLVE THIS PART PLEASE
HELP!
||
||
||
||
||
||
||
||
\/

end
--------------------------------------------------------------------------------
--
-- CALLBACKS
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
--
local function OnSkillInfo_(slvl)
-- Get the skill information for HUD display
return cooldown_timer;
end

--------------------------------------------------------------------------------
--
local function OnSkillUpdate_()
-- Update skill information each time the skill is updated by the player (level
up or menu access)
local plvl = GetProp(GetPyStruct("CharacterProperties", "Level"));
local slvl = GetCurrentSpellInfo();
skill_level = slvl;
end

--------------------------------------------------------------------------------
--
local function OnSkillCheck_()
-- Check if the player can cast the skill based on the remaining mana
return HasMana(mana_cost), false;
end
--------------------------------------------------------------------------------
--
local function OnPreSkill_()
-- Executed just before starting the skill
SetTargetListCharacterFilter(GetPyCst("AITargetList_CharacterFilter", "E
nemy"));
SetTargetListObjectFilter(GetPyCst("AITargetList_ObjectFilter", "Attacka
bleOnly"));
SetTargetListSorting(GetPyCst("AITargetList_Sorting", "NoSort"));
TargetListSearch(RANGE, ANGLE);
UseMana(mana_cost);
PlayFX(GetPyOID("AnimatedEffectTable", "Celest_Level_1_Player"));
if(IsTargetListEmpty()) then
Trace("No Target, FAIL SOUND!");
PlaySound("StaticBallKilled",false,0,false);
target, gameobject = GetTargetListTop();
end
end

--------------------------------------------------------------------------------
--
local function OnSkill_()
-- Executed when the skill event is received from the player
ApplyPropClass(CLASS_ID + skill_level);
if(gameobject) then
local dmg = SpellCombatRoll(target);
if(dmg > 0) then â - Integrity check, if dmg > 0 it means it's a char
acter
target:PlayFX(GetPyOID("AnimatedEffectTable", "Celest_Le
vel_1_Main"));
DoExplode(target);
end
end
end
--------------------------------------------------------------------------------
--

Das könnte Ihnen auch gefallen