PDA

View Full Version : [Custom Hero] Visitor



Schm0ftie
06-20-2011, 02:59 PM
[Custom Hero] Visitor


https://lh6.googleusercontent.com/-fsOz_XTZygY/TeaUo8RsAPI/AAAAAAAAAC0/_LjM2tIPfsI/s640/The%252520Visitor%252520New.jpg



Description:

The Visitor is a custom hero designed by AvantGarde, everything regarding
the hero concept, the numbers or spell changes belong to him.

You can find very detailed descriptions and background information to this
hero on the dream page (Dream: Visitor) (http://dream.heroesofnewerth.com/hero/AvantGarde/The%20Visitor) please also check out his other
heroes that can be found (Dream: AvantGarde) (http://dream.heroesofnewerth.com/hero/AvantGarde).

What is this all about?

I have tried for learning purpose to code this hero the same way he is
described on dream with all of his abilities but without creating custom
models or effects. I am not a modeler or someone who is familiar with
effects.

Why this hero?

I have decided to make this hero because of the fact that he was the
most wanted hero on the dream page at the moment I looked, he has
very detailed descriptions how his abilities should behave and I was
interested in his ultimate.

Differences between the designed hero at the coded one:

Since I am not the best one in coding and still learning and because of
current limits of the engine (that means somethings aren't existing now
and you have to work around) I was not able to port this hero 1:1.

I had to made some minor changes.

[E.M. Ellipse]
- the damage per second and the debuff do not stack when, so with Mass
Effectit is only possible to increase the area that is covered but not the
damage

Known bugs:

- once Mass Effect is learned items that influence cooldown like
Spellshards and Restoration Stone do not work (same for the refresh
button in practice mode)

- some states are missing icons and all ability descriptions are missing
because I hate creating stringtables and everything is descriped in detail
on the dream page of this hero

Conclusion:

It took me about 20 hours to create this hero, the most time I spend on
his ultimate (about 8 hours) and debugging the first skill. I have learned
a lot about how custom abilitie cost work (ultimate) and how to debug.
I had help from Oloko, asdf, tojooko and ElementUser from the irc, they
did help me by answering questions I had and help to debug code.
Special thanks to them. Furthermore special thanks to AvantGarde for
providing the design.

I am post this all because I want to share the experience I made and look
if someone has better ideas how to do something, so feel free to look into
the code, comment and to ask questions.

Thank you for reading!

Schm0ftie

Download:

- as a .s2t file Download (http://www.mediafire.com/?lsozybi6wnebk5t)

- as a .honmod file Download (http://www.mediafire.com/?d8u2sgond2xdafd)

Anarre
06-20-2011, 04:04 PM
Blurry picture of Mewtwo, what I've always wanted!

tojooko
06-20-2011, 07:20 PM
Well, seems I'm 10 minuntes late to send it throught IRC
I hope this code solves all problems:
(I'm not able to debug it, becouse HoN crashes when I try to start 2nd game... leaking engine(?) :( )


ability.entity:


<ability
name="Ability_Visitor1"

icon="icon.tga"
statuseffecttooltip=""

anim="ability_1"
casttime="400"
castactiontime="400"

maxlevel="4"
requiredlevel="1,3,5,7"

actiontype="target_entity"
targetradius="300"
targetmaterial="/shared/materials/area_cast_indicator_simple.material"
casteffecttype="Magic"
targetscheme="enemy_units"

impacteffect="/heroes/kunas/effects/ability_02/bolt_lightning_02_viewer.effect"

range="600"
manacost="100,110,120,130"
cooldowntime="20000,18000,16000,14000"

maxcharges="3"
>
<onimpact>
<applystate name="State_Stunned" duration="100" target="target_entity" />

<setvar0 a="target_maxhealth" b="0.075,0.10,0.125,0.15" op="mult"/> <!-- save damage dealt in var0 -->
<testnearby radius="300" origin="target_entity" targetscheme="visible_enemy_units" />
<evaluate a="result" b="6" op="min"/>
<setvar1 a="35,50,65,80" b="result" op="div"/> <!-- % slow for each target -->

<areaofeffect
radius="300"
maxtotalimpacts="6"
targetselection="closest"
targetscheme="visible_enemy_units"
effecttype="Magic"
ignore="target_entity"
>
<popup name="execution" a="var0" source="target_entity" target="target_entity" />
<damage effecttype="Magic" amount="var0" />
<applystate name="State_Visitor_Ability1_Slow" duration="2000" pushentity="true" />
<addcharges entity="stack_entity" count="var1" />
<setaccumulator entity="stack_entity" count="var1" />
</areaofeffect>

<!-- Do same to main target -->
<setvar0 a="var0" b="100" op="add"/>
<popup name="execution" a="var0" source="target_entity" target="target_entity" />
<damage effecttype="Magic" amount="var0" />
<applystate name="State_Visitor_Ability1_Slow" duration="2000" pushentity="true" />
<addcharges entity="stack_entity" count="35,50,65,80" />
<setaccumulator entity="stack_entity" count="35,50,65,80" />

</onimpact>

<modifier key="visitor_ult" modpriority="100"
ignorecooldown="true"
>

<checkcost>
<!-- Save the base mana cost in var0 -->
<setvar0 a="100,110,120,130" />

<!-- Compare if this Ability is on CD -->
<addcharges entity="this_proxy_entity" count="0" />
<compare a="result" b="0" op="ne">
<pushability source="source_entity" name="Ability_Visitor4" />
<addcharges entity="stack_entity" count="0" />
<compare a="result" b="0" op="eq">
<invalidate />
</compare>
<else>
<compare a="charges" b="1" op="eq">
<setvar1 a="var0" b="1.5" op="mult" />
<compare a="source_mana" b="var1" op="lt">
<invalidate />
</compare>
</compare>
<compare a="charges" b="2" op="eq">
<setvar1 a="var0" b="1.5" op="mult" />
<setvar1 a="var1" b="1.75" op="mult" />
<compare a="source_mana" b="var1" op="lt">
<invalidate />
</compare>
</compare>
<compare a="charges" b="3" op="eq">
<setvar1 a="var0" b="1.5" op="mult" />
<setvar1 a="var1" b="1.75" op="mult" />
<setvar1 a="var1" b="2" op="mult" />
<compare a="source_mana" b="var1" op="lt">
<invalidate />
</compare>
</compare>
</else>
</compare>
<else>
<compare a="source_mana" b="var0" op="lt">
<invalidate />
</compare>
</else>
</checkcost>

<activatecost>
<setvar0 a="100,110,120,130" />
<compare a="charges" b="0" op="eq" >
<popup name="manaburn" source="source_entity" target="source_entity" a="var0" />
<starttimer duration="20000,18000,16000,14000" />
<applystate name="State_Visitor_Ability1_CD" duration="20000,18000,16000,14000" pushentity="true"/>
<setproxy entity="this_entity" target="stack_entity" />
<addcharges />
</compare>
<else>
<compare a="charges" b="3" op="eq">
<setvar1 a="var0" b="1.5" op="mult" />
<setvar1 a="var1" b="1.75" op="mult" />
<setvar1 a="var1" b="2" op="mult" />
<takemana amount="result" b="var0" op="sub" />
<popup name="manaburn" source="source_entity" target="source_entity" a="var1" />
<pushability name="Ability_Visitor4" />
<removecharge entity="stack_entity" />
</compare>
<compare a="charges" b="2" op="eq">
<setvar1 a="var0" b="1.5" op="mult" />
<setvar1 a="var1" b="1.75" op="mult" />
<takemana amount="result" b="var0" op="sub" />
<popup name="manaburn" source="source_entity" target="source_entity" a="var1" />
<addcharges />
<pushability name="Ability_Visitor4" />
<removecharge entity="stack_entity" />
</compare>
<compare a="charges" b="1" op="eq">
<setvar1 a="var0" b="1.5" op="mult" />
<takemana amount="result" b="var0" op="sub" />
<popup name="manaburn" source="source_entity" target="source_entity" a="var1" />
<addcharges />
<pushability name="Ability_Visitor4" />
<removecharge entity="stack_entity" />
</compare>
</else>
</activatecost>

<ontimer>
<setcharges count="0" />
<resetcooldown />
</ontimer>

</modifier>

</ability>

state.entity:

<state
name="State_Visitor_Ability1_Slow"

icon="icon.tga"

maxcharges="100"
movespeedslowpercharge="0.01"


effecttype="StatusDebuff"
allowtransfer="true"
impactinterval="100"
>
<onimpact>
<evaluate a="lifetime_remaining" b="2000" op="div"/>
<setcharges entity="this_entity" a="result" b="accumulator" op="mult"/>
</onimpact>
</state>

Memphis_Doom
06-21-2011, 02:07 AM
Nicely done AvantGarde, Schm0ftie, Oloko, asdf and ElementUser.

I will test tonight!

Thanks

Schm0ftie
06-21-2011, 05:32 AM
@tojooko: Very nice code and clear. I did debug it, you can't use a vairable as the amount in a damage tag, you need to do it like this


<damage effecttype="Magic" amount="1" b="var0" op="mult" />
or

<damage effecttype="Magic" amount="100" b="var0" op="add" />

and the other thing was that <setaccumulator> use value instead of count (which is
used by addcharges)

Now it works perfectly, thank you. I did realy mess up the code because I wanted
to have a forg lightning, since I don't know much about effects I tried to change the
ability so I don't need to change the effect, at the end I did ruin the code :P

tojooko
06-21-2011, 07:21 AM
I'm glad to help you:P. Btw I'm impressed by ulti coding, realy nice job here. And about lightning I think saving main target in ent0 and using <playeffect will solve this problem (I suppose you did it already, sorry for talking obvoius things :P)

I'll think about ellipse coding, no idea yet how to make it stacking.