Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

troglodite

Members
  • Posts

    173
  • Joined

  • Last visited

    Never

Everything posted by troglodite

  1. Here we go again ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) Im trying to add [that system](http://www.touchofdeathforums.com/community/index.php?/topic/120709-csde-to-eo-conversation-system-v11/), all is pasted, I choose to add the _**"****OPTIONAL STEP** instead of the last part_" (view page to understand plz) But when I log into the game, a RTE appears: _Runtime error '9': Subscript out of range_ Debugged line (**CLIENT SIDE)**:``` ReDim Conv(Convnum).Conv(1 To .chatCount) ``` Any ideas? ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons//sad.png)
  2. Thx you so much! ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png) solved!
  3. Starting map xD I supposed that he was talking about walking between maps ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png)
  4. Where can I get it? And what "CS:DE" means??
  5. Use the Warp button of the Admin Panel You can set the X and Y and the number of the Map to warp walking on the warp tile
  6. Hello people! I was looking for a conversation system and I found [these](http://www.touchofdeathforums.com/community/index.php?/topic/120709-csde-to-eo-conversation-system-v11/), thats looks good, but the link to the _[modConv.bas](http://www.touchofdeathforums.com/smf/index.php?action=dlattach;topic=74220.0;attach=19038)_ is broken, somebody has it? Thnx!
  7. Its works ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons//biggrin.png)!!! Thank you Solved ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png)
  8. Omg, "your enumerations are waaaaay off, server has different ones then your client" ? O.O So I pasted it bad
  9. troglodite

    Designing GUI ?

    You dont need a programer for change the entire GUI Just replace the existing .jpg files of the GUI with others maked by you, but check that the text is placed in the same locations in the .jpg images, because if you want to change the text location, you will have to code it
  10. > k, just make sure i can login this time please? > > i know your afraid of your items and other graphics, but when ya delete them, i get errors xd > > so make a test account or something that doesnt error ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) Yeah, its Ok ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) User: Test Passw: 1234 Its as default
  11. > its good you want to learn, but without the code in client and server, the enumerations are useless, i cant follow the trail like this. > > i need every piece of code, from the sub thats called when ya press the button, to the sub that handles it server side. thats why i said pack it up again xd You are my hero, I´ll do it
  12. I think I have to learn someday xD so, I´ll post the codes that I think are the packets of client that sent to the server >! ``` >! ' Packets sent by server to client >! Public Enum ServerPackets >! SAlertMsg = 1 >! SLoginOk >! SNewCharClasses >! SClassesData >! SInGame >! SPlayerInv >! SPlayerInvUpdate >! SPlayerWornEq >! SPlayerHp >! SPlayerMp >! SPlayerStats >! SPlayerData >! SPlayerMove >! SNpcMove >! SPlayerDir >! SNpcDir >! SPlayerXY >! SPlayerXYMap >! SAttack >! SNpcAttack >! SCheckForMap >! SMapData >! SMapItemData >! SMapNpcData >! SMapDone >! SGlobalMsg >! SAdminMsg >! SPlayerMsg >! SMapMsg >! SSpawnItem >! SItemEditor >! SUpdateItem >! SREditor >! SSpawnNpc >! SNpcDead >! SNpcEditor >! SUpdateNpc >! SMapKey >! SEditMap >! SShopEditor >! SUpdateShop >! SSpellEditor >! SUpdateSpell >! SSpells >! SLeft >! SResourceCache >! SResourceEditor >! SUpdateResource >! SSendPing >! SDoorAnimation >! SActionMsg >! SPlayerEXP >! SBlood >! SAnimationEditor >! SUpdateAnimation >! SAnimation >! SMapNpcVitals >! SCooldown >! SClearSpellBuffer >! SSayMsg >! SOpenShop >! SResetShopAction >! SStunned >! SMapWornEq >! SBank >! STrade >! SCloseTrade >! STradeUpdate >! STradeStatus >! STarget >! SHotbar >! SHighIndex >! SSound >! STradeRequest >! SPartyInvite >! SPartyUpdate >! SPartyVitals >! SHandleProjectile >! SQuestEditor >! SUpdateQuest >! SPlayerQuest >! SQuestMessage >! SDoorsEditor >! SUpdateDoors >! ' Make sure SMSG_COUNT is below everything else >! SMSG_COUNT >! End Enum >! ' Packets sent by client to server >! Public Enum ClientPackets >! CNewAccount = 1 >! CDelAccount >! CLogin >! CAddChar >! CUseChar >! CSayMsg >! CEmoteMsg >! CBroadcastMsg >! CPlayerMsg >! CPlayerMove >! CPlayerDir >! CUseItem >! CAttack >! CUseStatPoint >! CPlayerInfoRequest >! CWarpMeTo >! CWarpToMe >! CWarpTo >! CSetSprite >! CGetStats >! CRequestNewMap >! CMapData >! CNeedMap >! CMapGetItem >! CMapDropItem >! CMapRespawn >! CMapReport >! CKickPlayer >! CBanList >! CBanDestroy >! CBanPlayer >! CRequestEditMap >! CRequestEditItem >! CSaveItem >! CRequestEditNpc >! CSaveNpc >! CRequestEditShop >! CSaveShop >! CRequestEditSpell >! CSaveSpell >! CSetAccess >! CWhosOnline >! CSetMotd >! CSearch >! CSpells >! CCast >! CQuit >! CSwapInvSlots >! CRequestEditResource >! CSaveResource >! CCheckPing >! CUnequip >! CRequestPlayerData >! CRequestItems >! CRequestNPCS >! CRequestResources >! CSpawnItem >! CRequestEditAnimation >! CSaveAnimation >! CRequestAnimations >! CRequestSpells >! CRequestShops >! CRequestLevelUp >! CForgetSpell >! CCloseShop >! CBuyItem >! CSellItem >! CChangeBankSlots >! CDepositItem >! CWithdrawItem >! CCloseBank >! CAdminWarp >! CTradeRequest >! CAcceptTrade >! CDeclineTrade >! CTradeItem >! CUntradeItem >! CHotbarChange >! CHotbarUse >! CSwapSpellSlots >! CAcceptTradeRequest >! CDeclineTradeRequest >! CPartyRequest >! CAcceptParty >! CDeclineParty >! CPartyLeave >! CProjecTileAttack >! CRequestEditQuest >! CSaveQuest >! CRequestQuests >! CPlayerHandleQuest >! CQuestLogUpdate >! CSaveDoor >! CRequestDoors >! CRequestEditDoors >! ' Make sure CMSG_COUNT is below everything else >! CMSG_COUNT >! End Enum >! ``` >! ``` >! Public Enum ServerPackets >! SAlertMsg = 1 >! SLoginOk >! SNewCharClasses >! SClassesData >! SInGame >! SPlayerInv >! SPlayerInvUpdate >! SPlayerWornEq >! SPlayerHp >! SPlayerMp >! SPlayerStats >! SPlayerData >! SPlayerMove >! SNpcMove >! SPlayerDir >! SNpcDir >! SPlayerXY >! SPlayerXYMap >! SAttack >! SNpcAttack >! SCheckForMap >! SMapData >! SMapItemData >! SMapNpcData >! SMapDone >! SGlobalMsg >! SAdminMsg >! SPlayerMsg >! SMapMsg >! SSpawnItem >! SItemEditor >! SUpdateItem >! SREditor >! SSpawnNpc >! SNpcDead >! SNpcEditor >! SUpdateNpc >! SMapKey >! SEditMap >! SShopEditor >! SUpdateShop >! SSpellEditor >! SUpdateSpell >! SSpells >! SLeft >! SResourceCache >! SResourceEditor >! SUpdateResource >! SSendPing >! SDoorAnimation >! SActionMsg >! SPlayerEXP >! SBlood >! SAnimationEditor >! SUpdateAnimation >! SAnimation >! SMapNpcVitals >! SCooldown >! SClearSpellBuffer >! SSayMsg >! SOpenShop >! SResetShopAction >! SStunned >! SMapWornEq >! SBank >! STrade >! SCloseTrade >! STradeUpdate >! STradeStatus >! STarget >! SHotbar >! SHighIndex >! SSound >! STradeRequest >! SPartyInvite >! SPartyUpdate >! SPartyVitals >! SHandleProjectile >! 'ALATAR >! SQuestEditor >! SUpdateQuest >! SPlayerQuest >! SQuestMessage >! '/ALATAR >! SSpawnEvent >! SEventMove >! SEventDir >! SEventChat >! SEventStart >! SEventEnd >! SPlayBGM >! SPlaySound >! SFadeoutBGM >! SStopSound >! SSwitchesAndVariables >! SMapEventData >! SDoorsEditor >! SUpdateDoors >! ' Make sure SMSG_COUNT is below everything else >! SMSG_COUNT >! End Enum >! ' Packets sent by client to server >! Public Enum ClientPackets >! CNewAccount = 1 >! CDelAccount >! CLogin >! CAddChar >! CUseChar >! CSayMsg >! CEmoteMsg >! CBroadcastMsg >! CPlayerMsg >! CPlayerMove >! CPlayerDir >! CUseItem >! CAttack >! CUseStatPoint >! CPlayerInfoRequest >! CWarpMeTo >! CWarpToMe >! CWarpTo >! CSetSprite >! CGetStats >! CRequestNewMap >! CMapData >! CNeedMap >! CMapGetItem >! CMapDropItem >! CMapRespawn >! CMapReport >! CKickPlayer >! CBanList >! CBanDestroy >! CBanPlayer >! CRequestEditMap >! CRequestEditItem >! CSaveItem >! CRequestEditNpc >! CSaveNpc >! CRequestEditShop >! CSaveShop >! CRequestEditSpell >! CSaveSpell >! CSetAccess >! CWhosOnline >! CSetMotd >! CSearch >! CSpells >! CCast >! CQuit >! CSwapInvSlots >! CRequestEditResource >! CSaveResource >! CCheckPing >! CUnequip >! CRequestPlayerData >! CRequestItems >! CRequestNPCS >! CRequestResources >! CSpawnItem >! CRequestEditAnimation >! CSaveAnimation >! CRequestAnimations >! CRequestSpells >! CRequestShops >! CRequestLevelUp >! CForgetSpell >! CCloseShop >! CBuyItem >! CSellItem >! CChangeBankSlots >! CDepositItem >! CWithdrawItem >! CCloseBank >! CAdminWarp >! CTradeRequest >! CAcceptTrade >! CDeclineTrade >! CTradeItem >! CUntradeItem >! CHotbarChange >! CHotbarUse >! CSwapSpellSlots >! CAcceptTradeRequest >! CDeclineTradeRequest >! CPartyRequest >! CAcceptParty >! CDeclineParty >! CPartyLeave >! CProjecTileAttack >! 'ALATAR >! CRequestEditQuest >! CSaveQuest >! CRequestQuests >! CPlayerHandleQuest >! CQuestLogUpdate >! '/ALATAR >! CEventChatReply >! CEvent >! CSwitchesAndVariables >! CRequestSwitchesAndVariables >! CSaveDoor >! CRequestDoors >! CRequestEditDoors >! ' Make sure CMSG_COUNT is below everything else >! CMSG_COUNT >! End Enum >! ``` >! ``` >! CSaveDoor >! CRequestDoors >! CRequestEditDoors >! ``` ``` >! SDoorsEditor >! SUpdateDoors >! ``` Is it right? Are these?
  13. > Have you named the button in properties? "CmdADoor" > > Right click the button click properties, its the top box. Yeah ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons//sad.png) > …But when I click on **"cmdADoor"** button on the Admin Panel…
  14. Hello! I added [this system](http://www.touchofdeathforums.com/community/index.php?/topic/121870-eo-advanced-doors-keys-and-switches-v-30/) but didnt work, and I paste everything, I review all the code like 4 times and its _all right_ But when I click on **"cmdADoor"** button on the Admin Panel (that button allows you to see the **"frmEditor_Doors"**) nothing appears ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons//sad.png) Somebody haved the same trouble? Can you help me? >! ![](http://i34.tinypic.com/2d8hmoy.jpg) >! ``` Private Sub cmdADoor_Click() >! ' If debug mode, handle error then exit out >! If Options.Debug = 1 Then On Error GoTo errorhandler >! If GetPlayerAccess(MyIndex) < ADMIN_DEVELOPER Then >! >! Exit Sub >! End If >! SendRequestEditdoors >! ' Error handler >! Exit Sub >! errorhandler: >! HandleError "cmdADoor_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext >! Err.Clear >! Exit Sub >! End Sub ``` Thx for reading ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png)
  15. Tested & Works ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png) thx!
  16. > If you wanted all the classes to be the same you could just remove the Case Select altogether and save the tiniest amount of memory ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons//biggrin.png) Like that? ``` ' ################################ ' ## Basic Calculations ## ' ################################ Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As Long If Index > MAX_PLAYERS Then Exit Function Select Case Vital Case HP GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case mp GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 End Select End Function ``` Is it Ok?? (I am newbie to coding ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png))
  17. Its and example to change it to same Hp & MP values for each class, but anyone can change it as he wants
  18. > nice explanation , but i don't think that help much ,, If you change the max hp of classes , then what's the point on having different classes? I figured someone would ask that ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) Well in my game, each class have to assign their points on a designated attributes, because if not, the class cant equip the special clothing (Kokiri clothing, Goron clothing…), but each class have some free points for free assignment ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png) And thats makes the difference between my classes
  19. Not a tutorial at all, but a guide for change the HP & MP that classes gets for each level So I was looking around the codes because my character class 2# haves more MP than my 7# ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) and its annoying because I want all my characters to have the same HP and MP (I have my reasons lol) So I search and find this: ``` ' ################################ ' ## Basic Calculations ## ' ################################ Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As Long If Index > MAX_PLAYERS Then Exit Function Select Case Vital Case HP Select Case GetPlayerClass(Index) Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 5 + 65 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 End Select Case mp Select Case GetPlayerClass(Index) Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 5 + 25 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 5 + 25 End Select End Select End Function ``` Here is where each class gets HP & MP for each level To change it, change the values of the cases **Example:** From original ``` Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 5 + 65 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 ``` To all classes gains the same HP for each level(Under Case HP): ``` Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 ``` So now each class will gain the same Hp as the 1st class (Warrior) And for MP (Under Case MP): ``` Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 ``` **Tested** ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png)
  20. I was looking around the codes because my character class 2# haves more MP than my 7# ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) and its annoying because I want all my characters to have the same HP and MP (I have my reasons lol) So I search and find this: ``` ' ################################ ' ## Basic Calculations ## ' ################################ Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As Long If Index > MAX_PLAYERS Then Exit Function Select Case Vital Case HP Select Case GetPlayerClass(Index) Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 5 + 65 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 End Select Case mp Select Case GetPlayerClass(Index) Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 5 + 25 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 5 + 25 End Select End Select End Function ``` Here is where HP & MP gains for each level of each class To change it, change the values of the cases **Example:** From original ``` Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2))* 5 + 65 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 ``` To all classes gains the same HP for each level ``` Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2)) * 15 + 150 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, Endurance) / 2))* 15 + 150 ``` So now each class will gain the same Hp as the 1st class (Warrior) ``` And for MP: Case 1 ' Warrior GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 Case 2 ' Mage GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 Case Else ' Anything else - Warrior by default GetPlayerMaxVital = ((GetPlayerLevel(Index) / 2) + (GetPlayerStat(Index, intelligence) / 2)) * 30 + 85 ``` Or you can change it by your own ideas for each class, whatever you want
  21. OH WELL I think that this is the problem: I changed this line NpcAttackPlayer MapNpcNum, Victim, Damage To this ``` SpellPlayer_Effect Vitals.HP, False, Victim, Damage, SpellNum ``` Because I dont want to hear the Npc sound, only the Spell sound But NOW, the Npc lows my life to 0!! AND Im still alive!! xD its better because there is no error crashing the server, but I think that I have to leave the code intact, and hear the Npc voice ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) So… Its Ok ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png), solved ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) Or maybe somebody can give me a tip to fix it :$ (?) Thx for reading!
  22. > Hover over each variable in the line of code that is erroring. (Spell, SpellNum and Type) > > A popup box should appear. Type in their contents here. Im not sure what you are telling me ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons//sad.png) BUT… I replace the entire "NpcSpellPlayer" and I let an Npc Spell Casting to kill me; I dead like 20 times and didnt get any run time error, hope it get solved, but Im litle frustrated because I didnt know WHY this error appears, hope It will never backs again...! Anyway, thank Abhi for helping me ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png) I will make this topic at "solved"
  23. > Hover over each variable. And type the contents of each. The Cases? Here the cases: >! ``` >! ' Spell Types >! Select Case Spell(spellnum).Type >! ' AOE Healing Spells >! Case SPELL_TYPE_HEALHP >! ' Make sure an npc waits for the spell to cooldown >! MaxHeals = 1 + NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) \ 25 >! If MapNpc(mapNum).NPC(MapNpcNum).Heals >= MaxHeals Then Exit Sub >! If MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) ! If Spell(spellnum).IsAoE Then >! For i = 1 To MAX_MAP_NPCS >! If MapNpc(mapNum).NPC(i).Num > 0 Then >! If MapNpc(mapNum).NPC(i).Vital(Vitals.HP) > 0 Then >! If isInRange(Spell(spellnum).AoE, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, MapNpc(mapNum).NPC(i).x, MapNpc(mapNum).NPC(i).y) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! >! MapNpc(mapNum).NPC(i).Vital(Vitals.HP) = MapNpc(mapNum).NPC(i).Vital(Vitals.HP) + InitDamage >! SendActionMsg mapNum, "+" & InitDamage, BrightGreen, 1, (MapNpc(mapNum).NPC(i).x * 32), (MapNpc(mapNum).NPC(i).y * 32) >! Call SendAnimation(mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_NPC, MapNpcNum) >! >! If MapNpc(mapNum).NPC(i).Vital(Vitals.HP) > NPC(MapNpc(mapNum).NPC(i).Num).HP Then >! MapNpc(mapNum).NPC(i).Vital(Vitals.HP) = NPC(MapNpc(mapNum).NPC(i).Num).HP >! End If >! >! MapNpc(mapNum).NPC(MapNpcNum).Heals = MapNpc(mapNum).NPC(MapNpcNum).Heals + 1 >! >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! Next >! Else >! ' Non AOE Healing Spells >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! >! MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) = MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) + InitDamage >! SendActionMsg mapNum, "+" & InitDamage, BrightGreen, 1, (MapNpc(mapNum).NPC(MapNpcNum).x * 32), (MapNpc(mapNum).NPC(MapNpcNum).y * 32) >! Call SendAnimation(mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_NPC, MapNpcNum) >! >! If MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) > NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).HP Then >! MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) = NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).HP >! End If >! >! MapNpc(mapNum).NPC(MapNpcNum).Heals = MapNpc(mapNum).NPC(MapNpcNum).Heals + 1 >! >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! >! ' AOE Damaging Spells >! Case SPELL_TYPE_DAMAGEHP >! ' Make sure an npc waits for the spell to cooldown >! If Spell(spellnum).IsAoE Then >! For i = 1 To Player_HighIndex >! If IsPlaying(i) Then >! If GetPlayerMap(i) = mapNum Then >! If isInRange(Spell(spellnum).AoE, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(i), GetPlayerY(i)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(victim).Stat(Stats.intelligence) / 2 >! If Damage ! SendActionMsg GetPlayerMap(i), "RESIST!", Pink, 1, (GetPlayerX(i) * 32), (GetPlayerY(i) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.HP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, MapNpcNum >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! End If >! Next >! ' Non AoE Damaging Spells >! Else >! If isInRange(Spell(spellnum).Range, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(victim), GetPlayerY(victim)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(victim).Stat(Stats.intelligence) / 2 >! If Damage ! SendActionMsg GetPlayerMap(victim), "SIN EFECTO!", Pink, 1, (GetPlayerX(victim) * 32), (GetPlayerY(victim) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.HP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, victim >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! Case SPELL_TYPE_DAMAGEMP >! ' Make sure an npc waits for the spell to cooldown >! If Spell(spellnum).IsAoE Then >! For i = 1 To Player_HighIndex >! If IsPlaying(i) Then >! If GetPlayerMap(i) = mapNum Then >! If isInRange(Spell(spellnum).AoE, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(i), GetPlayerY(i)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(i).Stat(Stats.willpower) >! If Damage ! SendActionMsg GetPlayerMap(i), "RESIST!", Pink, 1, (GetPlayerX(i) * 32), (GetPlayerY(i) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.MP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, MapNpcNum >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! End If >! Next >! ' Non AoE DamagingMP Spells >! Else >! If isInRange(Spell(spellnum).Range, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(victim), GetPlayerY(victim)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(victim).Stat(Stats.willpower) >! If Damage ! SendActionMsg GetPlayerMap(victim), "RESIST!", Pink, 1, (GetPlayerX(victim) * 32), (GetPlayerY(victim) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.MP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, victim >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! >! End Select >! ``` Here the entire code: >! ``` >! Sub NpcSpellPlayer(ByVal MapNpcNum As Long, ByVal victim As Long, SpellSlotNum As Long) >! Dim mapNum As Long >! Dim i As Long >! Dim n As Long >! Dim spellnum As Long >! Dim Buffer As clsBuffer >! Dim InitDamage As Long >! Dim Damage As Long >! Dim MaxHeals As Long >! ' Check for subscript out of range >! If MapNpcNum MAX_MAP_NPCS Or IsPlaying(victim) = False Then >! Exit Sub >! End If >! ' Check for subscript out of range >! If MapNpc(GetPlayerMap(victim)).NPC(MapNpcNum).Num ! Exit Sub >! End If >! If SpellSlotNum MAX_NPC_SPELLS Then Exit Sub >! ' The Variables >! mapNum = GetPlayerMap(victim) >! spellnum = NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Spell(SpellSlotNum) >! ' Send this packet so they can see the person attacking >! Set Buffer = New clsBuffer >! Buffer.WriteLong SNpcAttack >! Buffer.WriteLong MapNpcNum >! SendDataToMap mapNum, Buffer.ToArray() >! Set Buffer = Nothing >! ' CoolDown Time >! If MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) > GetTickCount Then Exit Sub >! ' Spell Types >! Select Case Spell(spellnum).Type >! ' AOE Healing Spells >! Case SPELL_TYPE_HEALHP >! ' Make sure an npc waits for the spell to cooldown >! MaxHeals = 1 + NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) \ 25 >! If MapNpc(mapNum).NPC(MapNpcNum).Heals >= MaxHeals Then Exit Sub >! If MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) ! If Spell(spellnum).IsAoE Then >! For i = 1 To MAX_MAP_NPCS >! If MapNpc(mapNum).NPC(i).Num > 0 Then >! If MapNpc(mapNum).NPC(i).Vital(Vitals.HP) > 0 Then >! If isInRange(Spell(spellnum).AoE, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, MapNpc(mapNum).NPC(i).x, MapNpc(mapNum).NPC(i).y) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! >! MapNpc(mapNum).NPC(i).Vital(Vitals.HP) = MapNpc(mapNum).NPC(i).Vital(Vitals.HP) + InitDamage >! SendActionMsg mapNum, "+" & InitDamage, BrightGreen, 1, (MapNpc(mapNum).NPC(i).x * 32), (MapNpc(mapNum).NPC(i).y * 32) >! Call SendAnimation(mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_NPC, MapNpcNum) >! >! If MapNpc(mapNum).NPC(i).Vital(Vitals.HP) > NPC(MapNpc(mapNum).NPC(i).Num).HP Then >! MapNpc(mapNum).NPC(i).Vital(Vitals.HP) = NPC(MapNpc(mapNum).NPC(i).Num).HP >! End If >! >! MapNpc(mapNum).NPC(MapNpcNum).Heals = MapNpc(mapNum).NPC(MapNpcNum).Heals + 1 >! >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! Next >! Else >! ' Non AOE Healing Spells >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! >! MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) = MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) + InitDamage >! SendActionMsg mapNum, "+" & InitDamage, BrightGreen, 1, (MapNpc(mapNum).NPC(MapNpcNum).x * 32), (MapNpc(mapNum).NPC(MapNpcNum).y * 32) >! Call SendAnimation(mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_NPC, MapNpcNum) >! >! If MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) > NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).HP Then >! MapNpc(mapNum).NPC(MapNpcNum).Vital(Vitals.HP) = NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).HP >! End If >! >! MapNpc(mapNum).NPC(MapNpcNum).Heals = MapNpc(mapNum).NPC(MapNpcNum).Heals + 1 >! >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! >! ' AOE Damaging Spells >! Case SPELL_TYPE_DAMAGEHP >! ' Make sure an npc waits for the spell to cooldown >! If Spell(spellnum).IsAoE Then >! For i = 1 To Player_HighIndex >! If IsPlaying(i) Then >! If GetPlayerMap(i) = mapNum Then >! If isInRange(Spell(spellnum).AoE, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(i), GetPlayerY(i)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(victim).Stat(Stats.intelligence) / 2 >! If Damage ! SendActionMsg GetPlayerMap(i), "RESIST!", Pink, 1, (GetPlayerX(i) * 32), (GetPlayerY(i) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.HP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, MapNpcNum >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! End If >! Next >! ' Non AoE Damaging Spells >! Else >! If isInRange(Spell(spellnum).Range, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(victim), GetPlayerY(victim)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(victim).Stat(Stats.intelligence) / 2 >! If Damage ! SendActionMsg GetPlayerMap(victim), "SIN EFECTO!", Pink, 1, (GetPlayerX(victim) * 32), (GetPlayerY(victim) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.HP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, victim >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! Case SPELL_TYPE_DAMAGEMP >! ' Make sure an npc waits for the spell to cooldown >! If Spell(spellnum).IsAoE Then >! For i = 1 To Player_HighIndex >! If IsPlaying(i) Then >! If GetPlayerMap(i) = mapNum Then >! If isInRange(Spell(spellnum).AoE, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(i), GetPlayerY(i)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(i).Stat(Stats.willpower) >! If Damage ! SendActionMsg GetPlayerMap(i), "RESIST!", Pink, 1, (GetPlayerX(i) * 32), (GetPlayerY(i) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.MP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, MapNpcNum >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! End If >! Next >! ' Non AoE DamagingMP Spells >! Else >! If isInRange(Spell(spellnum).Range, MapNpc(mapNum).NPC(MapNpcNum).x, MapNpc(mapNum).NPC(MapNpcNum).y, GetPlayerX(victim), GetPlayerY(victim)) Then >! InitDamage = Spell(spellnum).Vital + (NPC(MapNpc(mapNum).NPC(MapNpcNum).Num).Stat(Stats.intelligence) / 2) >! Damage = InitDamage - Player(victim).Stat(Stats.willpower) >! If Damage ! SendActionMsg GetPlayerMap(victim), "RESIST!", Pink, 1, (GetPlayerX(victim) * 32), (GetPlayerY(victim) * 32) >! Exit Sub >! Else >! SpellPlayer_Effect Vitals.MP, False, victim, Damage, spellnum >! SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, victim >! MapNpc(mapNum).NPC(MapNpcNum).SpellTimer(SpellSlotNum) = GetTickCount + Spell(spellnum).CDTime * 1000 >! Exit Sub >! End If >! End If >! End If >! >! End Select >! End Sub >! ```
  24. > Make sure spell num > 0 and < MAX_Spells. Yes ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons//sad.png)
  25. Hello! I am having a trouble when I fight a NPC that cast spells, at the moment before he kills me (when I have poor health and no potions/I let him to kill me) "Run-time error: Subscript out of range" Debugged line In NpcSpellPlayer: ``` Select Case Spell(spellnum).Type ``` Its about the [NPC Spells v.2.0.0](http://www.touchofdeathforums.com/community/index.php?/topic/106297-eo-npc-spells-v200/) code that I added Thx for reading
×
×
  • Create New...