bivr123
New Member
- Joined
- Aug 13, 2011
- Messages
- 17
- Reaction score
- 1
Hi, could someone help me fix this code?
I want my summon to change its looktype when the player has a fight condition, and when it's not back to the previous looktype. And even being wild to have only one looktype
here the code:
As you can see, in outfits_wild it is the looktype that the wild will use. In outfits_poke the summon will use. So when the player has this specific summon, he will change the looktype when the player enters a fight condition.
Thanks!
I want my summon to change its looktype when the player has a fight condition, and when it's not back to the previous looktype. And even being wild to have only one looktype
here the code:
LUA:
outfits_wild = {
["Typhlosion"] = {349},
["Quilava"] = {348},
["Cyndaquil"] = {347}
}
outfits_poke = {
["Typhlosion"] = {352},
["Quilava"] = {351},
["Cyndaquil"] = {350}
}
function fightOutfit(cid, index)
if isSummon(cid) then
local outfit = outfits_poke[getCreatureName(cid)]
if not getCreatureCondition(cid, CONDITION_INFIGHT) or isInArray(outfit, getCreatureOutfit(cid).lookType) then
if not outfit[index] then
index = 1
end
doSetCreatureOutfit(cid, {lookType = outfit[index]}, -1)
end
addEvent(fightOutfit, 300, cid, index + 1)
end
end
Thanks!