tslusny Posted May 26, 2012 Author Share Posted May 26, 2012 This tutorial is required [http://www.touchofdeathforums.com/smf2/index.php/topic,78666.0.html](http://www.touchofdeathforums.com/smf2/index.php/topic,78666.0.html)Thx to Ryoku Hasu for making Buff system.And thx to Qazek for Transformation spell baseSome parts of this tutorial are from Qazeks tutorialCredits to Ryoku Hasu and QazekCLIENT SIDEOpen Spell Editor and add:label:**name** - lblSprite**caption** - Transformation sprite:scroll bar:**name** - scrlSpriteAdd to your scrollbar:``` lblSprite.Caption = "Transformation sprite: " & scrlSprite.Value Spell(EditorIndex).Sprite = scrlSprite.Value```Go to modGameEditors, find sub:**SpellEditorInit**In this sub find:``` .scrlStun.Value = Spell(EditorIndex).StunDuration```Add:``` .scrlSprite.Value = Spell(EditorIndex).Sprite```Go to modTypes, find:```Private Type SpellRec```Add to this type:``` Sprite As Long```Go to PlayerRec and find``` Sprite As Long```add below it``` Spriteold As Long```SERVER SIDEGo to modTypes, find:```Private Type SpellRec```Add to this type:``` Sprite As Long```Go to PlayerRec and find``` Sprite As Long```add below it``` Spriteold As Long```Again in PlayerRecSearch for```Equipment(1 To Equipment.Equipment_Count - 1) As Long```Add below it```EquipmentOld(1 To Equipment.Equipment_Count - 1) As Long```And finnaly still in PlayerRec add to bottom of PlayerRec```Transformed As Boolean```Go to Sub JoinGame Place``` SetPlayerSpriteOld index, Player(index).Sprite SetPlayerEquipmentOld index, Player(index).Equipment(1), Weapon SetPlayerEquipmentOld index, Player(index).Equipment(2), Armor SetPlayerEquipmentOld index, Player(index).Equipment(3), Shield SetPlayerEquipmentOld index, Player(index).Equipment(4), Helmet```after``` Call SendHotbar(index)```Search for```Sub SetPlayerSprite(ByVal index As Long, ByVal Sprite As Long)```after that sub paste```Sub SetPlayerSpriteOld(ByVal index As Long, ByVal Sprite As Long) Player(index).Spriteold = SpriteEnd Sub```Search for```Sub SetPlayerEquipment(ByVal index As Long, ByVal InvNum As Long, ByVal EquipmentSlot As Equipment)```after that sub paste```Sub SetPlayerEquipmentOld(ByVal index As Long, ByVal InvNum As Long, ByVal EquipmentSlot As Equipment) Player(index).EquipmentOld(EquipmentSlot) = InvNumEnd Sub```Search for``` ' Check if player was the only player on the map and stop npc processing if so```Above place```SetPlayerSprite index, Player(index).Spriteold SetPlayerEquipment index, Player(index).EquipmentOld(1), Weapon SetPlayerEquipment index, Player(index).EquipmentOld(2), Armor SetPlayerEquipment index, Player(index).EquipmentOld(3), Shield SetPlayerEquipment index, Player(index).EquipmentOld(4), Helmet```In Sub CastSpellSearch for```Case 0 ' self-cast target```Here find```Case SPELL_TYPE_BUFF```Above```DidCast = true```Paste```If Player(index).Transformed = False Then If Spell(SpellNum).Sprite > 0 Then SetPlayerSpriteOld index, Player(index).Sprite SetPlayerSprite index, Player(index).Spriteold SetPlayerSprite index, Spell(SpellNum).Sprite SetPlayerEquipmentOld index, Player(index).Equipment(1), Weapon SetPlayerEquipmentOld index, Player(index).Equipment(2), Armor SetPlayerEquipmentOld index, Player(index).Equipment(3), Shield SetPlayerEquipmentOld index, Player(index).Equipment(4), Helmet SetPlayerEquipment index, Player(index).EquipmentOld(1), Weapon SetPlayerEquipment index, Player(index).EquipmentOld(2), Armor SetPlayerEquipment index, Player(index).EquipmentOld(3), Shield SetPlayerEquipment index, Player(index).EquipmentOld(4), Helmet SetPlayerEquipment index, 0, Weapon SetPlayerEquipment index, 0, Armor SetPlayerEquipment index, 0, Shield SetPlayerEquipment index, 0, Helmet Player(index).Transformed = True Call SendWornEquipment(index) Call SendMapEquipment(index) Call SendVital(index, Vitals.HP) Call SendVital(index, Vitals.MP) ' send vitals to party if in one If TempPlayer(index).inParty > 0 Then SendPartyVitals TempPlayer(index).inParty, index Call SendPlayerData(index) End If Else PlayerMsg index, "You can not transform this player!", BrightRed End If```Now search for (still in Sub CastSpell)```Case 1, 3 ' self-cast AOE & targetted AOE```Here find```Case SPELL_TYPE_BUFF```Above```DidCast = true```Add```If Player(Target).Transformed = False Then If Spell(SpellNum).Sprite > 0 Then SetPlayerSpriteOld Target, Player(Target).Sprite SetPlayerSprite Target, Player(Target).Spriteold SetPlayerSprite Target, Spell(SpellNum).Sprite SetPlayerEquipmentOld Target, Player(Target).Equipment(1), Weapon SetPlayerEquipmentOld Target, Player(Target).Equipment(2), Armor SetPlayerEquipmentOld Target, Player(Target).Equipment(3), Shield SetPlayerEquipmentOld Target, Player(Target).Equipment(4), Helmet SetPlayerEquipment Target, Player(Target).EquipmentOld(1), Weapon SetPlayerEquipment Target, Player(Target).EquipmentOld(2), Armor SetPlayerEquipment Target, Player(Target).EquipmentOld(3), Shield SetPlayerEquipment Target, Player(Target).EquipmentOld(4), Helmet SetPlayerEquipment Target, 0, Weapon SetPlayerEquipment Target, 0, Armor SetPlayerEquipment Target, 0, Shield SetPlayerEquipment Target, 0, Helmet Player(Target).Transformed = True Call SendWornEquipment(Target) Call SendMapEquipment(Target) Call SendVital(Target, Vitals.HP) ' send vitals to party if in one If TempPlayer(Target).inParty > 0 Then SendPartyVitals TempPlayer(Target).inParty, Target Call SendPlayerData(Target) End If Else PlayerMsg index, "You can not transform this player!", BrightRed End If```And this same code add to```Case 2 ' targetted```In```Case SPELL_TYPE_BUFF```Above```DidCast = true```Now in Sub ServerLoop search for```TempPlayer(i).Buffs(x) = 0```Add above that``` SetPlayerSprite (i), Player(i).Spriteold SetPlayerEquipment (i), Player(i).EquipmentOld(1), Weapon SetPlayerEquipment (i), Player(i).EquipmentOld(2), Armor SetPlayerEquipment (i), Player(i).EquipmentOld(3), Shield SetPlayerEquipment (i), Player(i).EquipmentOld(4), Helmet Player(i).Transformed = False Call SendPlayerData(i) Call SendWornEquipment(i) Call SendMapEquipment(i) Call SendVital(i, Vitals.HP) Call SendVital(i, Vitals.MP) ' send vitals to party if in one If TempPlayer(i).inParty > 0 Then SendPartyVitals TempPlayer(i).inParty, i```Now go to Sub UseItemHere search for```ItemNum = GetPlayerInvItemNum(index, InvNum)```Add below it ```If Player(index).Transformed = True Then If Item(ItemNum).Type >= ITEM_TYPE_WEAPON And Item(ItemNum).Type <= ITEM_TYPE_SHIELD Then PlayerMsg index, "Cant equip items while transformed.", BrightRed Exit Sub End If End If```And now u have working Buff Transformation in your game. I tested this in my game and it working.Please report any bugs you will found. Link to comment Share on other sites More sharing options...
hisherwin Posted May 26, 2012 Share Posted May 26, 2012 i'l Try it :D Thanks Link to comment Share on other sites More sharing options...
tslusny Posted May 27, 2012 Author Share Posted May 27, 2012 Np :D Link to comment Share on other sites More sharing options...
or3o Posted May 28, 2012 Share Posted May 28, 2012 What happens if you cast transform with a full inventory? Link to comment Share on other sites More sharing options...
tslusny Posted May 29, 2012 Author Share Posted May 29, 2012 it unequip your equipped items but it dont give them to your inventory they just disappear from equipped slots and after time it reapear ,but stats from items disappear and reapear too. So it just unequip items but dont give them to inventory. Link to comment Share on other sites More sharing options...
iraniel Posted July 22, 2012 Share Posted July 22, 2012 idk how to use it can anyone tell me how to turn? Link to comment Share on other sites More sharing options...
tslusny Posted July 23, 2012 Author Share Posted July 23, 2012 If scrlsprite value in spell editor is more than 0 and your spell is spell type buff then when you use that spell you will transform to that sprite number Link to comment Share on other sites More sharing options...
theabll007 Posted April 28, 2013 Share Posted April 28, 2013 On the game and get into the game again, put the item on the bottom is missing. Link to comment Share on other sites More sharing options...
Clueless Posted June 3, 2013 Share Posted June 3, 2013 Hi, I think the link is broken. It sends me to the forum page> This tutorial is required [http://www.touchofde…ic,78666.0.html](http://www.touchofdeathforums.com/smf2/index.php/topic,78666.0.html) Link to comment Share on other sites More sharing options...
Swizl Posted June 3, 2013 Share Posted June 3, 2013 > Hi, I think the link is broken. It sends me to the forum pageThe thread doesn't exist anymore then. Link to comment Share on other sites More sharing options...
Clueless Posted June 3, 2013 Share Posted June 3, 2013 Then what do If I need to use this? Link to comment Share on other sites More sharing options...
Swizl Posted June 3, 2013 Share Posted June 3, 2013 You ? Honestly there's nothing you can do and you most probably won't be able to use this. Link to comment Share on other sites More sharing options...
abhi2011 Posted June 4, 2013 Share Posted June 4, 2013 > Then what do If I need to use this?[Check this link out.](http://www.touchofdeathforums.com/community/index.php?/topic/130611-old-links-to-new/) Link to comment Share on other sites More sharing options...
Irvan Shihap Posted February 2, 2016 Share Posted February 2, 2016 i founds this code a bug,.sometime equip used so to roolback,. how this solved -,- ? Link to comment Share on other sites More sharing options...
Gahduvdeth Posted February 2, 2016 Share Posted February 2, 2016 ![](http://i.imgur.com/zCAcGd6.jpg) Link to comment Share on other sites More sharing options...
Irvan Shihap Posted February 2, 2016 Share Posted February 2, 2016 @'Gahduvdeth':> ![](http://i.imgur.com/zCAcGd6.jpg)oh oke im sorry,. i think still can reply this thread. :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now