Forum > Serverside Modding
[QUESTION] Morphing item
<< < (2/4) > >>
bizzlesnaff:
No that's not possible. But i thought u try to morph the player when the item is worn...maybe it is an translation mistake by me...worn means damaged so in wow the item is shown "red". trinkets, rings, back, neck etc. can never lose durability.
Rochet2:
You either need to use a spell or a script.
Spell would nicely take use of the aura system incase the player has multiple morphs. Lets say he has your trinket and noggenfogger, the spell system would probably be able to restore the other when the other wears out and maybe take into account other things.
If you apply the morph on equip (or on spell cast) and then the player morphs to something else (noggenfogger) it might be a hassle to try to restore the morph from the trinket after that without checking all the time for the correct displayid.
What core do you use for the server?
Mangos based cores (mangos, cmangos, trinitycore.. ) do not have an "on equip" hook in their C++ scripting API. Unsure about arcemu ?_? This means that you would need to modify the core to add such a hook. A workaround for this could be .. yet again .. using a spell. By using a spell on use for the item you can script the spell to do what you want in C++. You can use the same spell for all items you create since you can script it to do different things according to the item entry or other data.
Did I mention a spell yet? :3
--- Quote from: "bizzlesnaff" ---No that's not possible. But i thought u try to morph the player when the item is worn...maybe it is an translation mistake by me...worn means damaged so in wow the item is shown "red". trinkets, rings, back, neck etc. can never lose durability. --- End quote --- by worn he probably meant that he wanted the morph to be visible when the item is equipped/weared.
Daweo:
--- Quote from: "Смердокрыл" ---Hey everyone! Any good tutorial on making an item that morphs when worn? No spell-morphs, please, I need to use displayids. --- End quote ---
You can make hook in core to catch this event. For example in TrinityCore in file Player.cpp, It is tested.
--- Code: ---void Player::DurabilityPointsLoss(Item* item, int32 points) . . . if (pNewDurability == 0 && pOldDurability > 0 && item->IsEquipped()) { _ApplyItemMods(item, item->GetSlot(), false);
// Morph on durability loss SetDisplayId(999); ChatHandler(GetSession()).PSendSysMessage("It's broken and You are morphed!"); } . . . item->SetUInt32Value(ITEM_FIELD_DURABILITY, pNewDurability);
--- End code ---
I hope I helped You...
Смердокрыл:
Rochet2 and Daweo's replies look promising, other than I have no experience in C++ at all, so I dont really get what demonic rituals do I have to perform with this ancient scripts...
Daweo:
--- Quote from: "Смердокрыл" ---Rochet2 and Daweo's replies look promising, other than I have no experience in C++ at all, so I dont really get what demonic rituals do I have to perform with this ancient scripts... --- End quote ---
So, what you really wanted? Morph on item equip or on durability loss? :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
|