Spell [TFS 1.x] Summon: Hate

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by BboyChaos, Oct 17, 2016.

  1. BboyChaos

    BboyChaos New Member

    Joined:
    May 20, 2014
    Messages:
    10
    Likes Received:
    2
    Best Answers:
    0
    Causes targeted monster to aggro the players summon.

    Code (Text):
    1. local combat = Combat()
    2. combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    3. combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
    4.  
    5. function onCastSpell(cid, var)
    6.  
    7.   local player = Player(cid)
    8.   local player_summon = Player(cid):getSummons()
    9.  
    10.   if not next(player_summon) then
    11.     player:getPosition():sendMagicEffect(CONST_ME_POFF)
    12.     player:sendCancelMessage("You don't have any summons.")
    13.     return false
    14.   end
    15.  
    16.   for i = 1, #player_summon, +1
    17.   do
    18.     doChallengeCreature(player_summon[i], player:getTarget())
    19.     player_summon[i]:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    20.     player:getTarget():getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    21.     return true
    22.   end
    23.  
    24.   return doCombat(cid, combat, var)
    25. end
     
    kito2 likes this.
  2. loldinis

    loldinis New Member

    Joined:
    May 21, 2010
    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Hey Bboy
    Do you know how does a spell that summon a monster in specific? And convinces him too
     
  3. Static_

    Static_ Premium User Premium User

    Joined:
    Feb 14, 2015
    Messages:
    2,932
    Likes Received:
    1,233
    Best Answers:
    165
    monster:setMaster(creature)
     
  4. loldinis

    loldinis New Member

    Joined:
    May 21, 2010
    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Xeraphus, this is my code.
    How do I convince a summoned creature, in that code?

     
  5. Static_

    Static_ Premium User Premium User

    Joined:
    Feb 14, 2015
    Messages:
    2,932
    Likes Received:
    1,233
    Best Answers:
    165
    are you using 1.2 or 0.4?
     
  6. loldinis

    loldinis New Member

    Joined:
    May 21, 2010
    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
  7. Static_

    Static_ Premium User Premium User

    Joined:
    Feb 14, 2015
    Messages:
    2,932
    Likes Received:
    1,233
    Best Answers:
    165
    Code (Text):
    1.  
    2. local combat = Combat()
    3. combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
    4. combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS)
    5. combat:setArea(createCombatArea(AREA_CROSS1X1))
    6.  
    7. local maxsummons = 2
    8.  
    9. function onCastSpell(creature, variant)
    10.     local summoncount = creature:getSummons()
    11.     local pos = creature:getPosition()
    12.     if #summoncount < maxsummons then
    13.         for i = 1, maxsummons - #summoncount do
    14.             local summon = Game.createMonster("Poison Plant", pos)
    15.             if summon then
    16.                 summon:setMaster(creature)
    17.             end
    18.         end
    19.     end
    20.     creature:say("Watch my Tree!", TALKTYPE_MONSTER_SAY)
    21.     return combat:execute(creature, variant)
    22. end
     
  8. loldinis

    loldinis New Member

    Joined:
    May 21, 2010
    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Convince Dont Work :c
    [​IMG]
     
  9. kito2

    kito2 mtibia-global.com Just a noob

    Joined:
    Mar 9, 2009
    Messages:
    3,358
    Likes Received:
    89
    Best Answers:
    1
    Amazing idea.
     

Share This Page

Loading...