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

dragonlord52

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Posts posted by dragonlord52

  1. Alright so I am working on a quest script but it wasn't working so I did my typical thing to test what is and isn't working and I have come across an issue. Under the Case 0 in scripted NPC I have a Call TakeItem command (yes it is in my main). I have two NPCs with this command but only one of them works. I have 2 other NPCs and two other cases with the same command and neither work. Any ideas?

    Here's the main ScriptedNPC

    ' Executes whenever a scripted NPC does an action.
    Sub ScriptedNPC(Index, Script)
    Select Case Script
    Case 0
    Call TakeItem(Index, 1, 1)
    Exit Sub

    Case 1
    Call TakeItem(Index, 1, 1)
    Exit Sub

    Case 2
    Call TakeItem(Index, 1, 1)
    Exit Sub

    Case Else
    Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)
    Exit Sub
    End Select
    End Sub
  2. Alright so I've almost given up on making this thing work. I'm making a weapon proficiency script and I have a MAJOR problem. For some reason when you buy something at a shop the item script doesn't work breaking attacking. Not only that but when you buy one item of the weapon type all the weapon types become broken at the same time! When you don't buy it and you find the first weapon they all become usable but then you can't have shops or else all the non found ones from that point on break. IDK how to even start fixing this problem and everything I'm doing is in SADscript so there wasn't any source edits…ever. The last problem is that the staff weapon type all say that the weapon is about to break! -1/-1 durability...that doesn't make sense since the weapon is indestructible then when you drop it you get an error and the game closes on you.

    Please do not tell me to just use someone's script that does work as I cannot learn from mistakes by doing so.

    Note that this was all fine BEFORE the script install. So here is the code, all help is GREATLY appreciated.

    > '\\\\\\\\\\\\\\\\\\\\ WEAPON SKILL SCRIPT /////////////////////
    > Sub WeaponSkill(Index)
    > weapon = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
    > weapon_type = GetVar("scripts\weapons.ini", "" & weapon & "", "weapon_type")
    > weapon_exp = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", weapon_type & "_exp")
    > weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
    > next_level_exp = GetVar("scripts\weaponxp.ini", "EXPERIENCE", "" & weapon_level & "")
    > weapon_exp = Int(weapon_exp) + 1
    > If Int(weapon_exp) >= Int(next_level_exp) Then
    > weapon_level = Int(weapon_level) + 1
    > weapon_exp = Int(weapon_exp) - Int(next_level_exp)
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "", "" & weapon_level & "")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", weapon_type & "_exp", "" & weapon_exp & "")
    > Call PlayerMsg(Index, "Your skill in " & weapon_type & " has increased to level " & weapon_level & ".", 14)
    > Else
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", weapon_type & "_exp", "" & weapon_exp & "")
    > End If
    > End Sub
    > '///////////////// END WEAPON SKILL SCRIPT \\\\\\\\\\\\\\\\\\\\\

    Attack Script

    > ' Executes when a player presses the CONTROL key.
    > Sub OnAttack(Index, Damage)
    > Dim Target
    >
    > If Int(Damage) > 0 Then
    > If Int(GetPlayerTarget(Index)) > 0 Then
    > Target = GetPlayerTarget(Index)
    > map = GetPlayerMap(Index)
    > x = GetNpcX(map, Target)
    > y = GetNpcY(map, Target)
    > weapon = GetPlayerWeaponSlot(Index)
    > If Int(weapon) > 0 Then
    > weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
    > weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
    > weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
    > damage2 = Rand(0, Int(weapon_level))
    > Call DamagePlayer(Index, Target, Damage + damage2)
    > Else
    > Call DamagePlayer(Index, Target, Damage)
    > End If
    > Call SpellAnim(16, map, x, y)
    > Else
    > Target = GetPlayerTargetNPC(Index)
    > map = GetPlayerMap(Index)
    > x = GetNpcX(map, Target)
    > y = GetNpcY(map, Target)
    > level = GetPlayerLevel(Index)
    > points = GetPlayerPOINTS(Index)
    > 'Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "TEMP", "tmp_level", level)
    > 'Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "TEMP", "tmp_points", points)
    >
    > weapon = GetPlayerWeaponSlot(Index)
    > If Int(weapon) > 0 Then
    > weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
    > weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
    > weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
    > damage2 = Rand(0, Int(weapon_level))
    > Call DamageNPC(Index, Target, Damage + damage2)
    > Else
    > Call DamageNPC(Index, Target, Damage)
    > End If
    > Call SpellAnim(16, map, x, y)
    > Call WeaponSkill(Index)
    > End If
    > End If
    > End Sub
    >
    > Sub OnArrowHit(Index, Damage)
    > Dim Target
    >
    > If Int(Damage) > 0 Then
    > If Int(GetPlayerTarget(Index)) > 0 Then
    > Target = GetPlayerTarget(Index)
    > weapon = GetPlayerWeaponSlot(Index)
    > If Int(weapon) > 0 Then
    > weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
    > weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
    > weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
    > damage2 = Rand(0, Int(weapon_level))
    > Call DamagePlayer(Index, Target, Damage + damage2)
    > Else
    > Call DamagePlayer(Index, Target, Damage)
    > End If
    > Else
    > Target = GetPlayerTargetNPC(Index)
    > weapon = GetPlayerWeaponSlot(Index)
    > If Int(weapon) > 0 Then
    > weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
    > weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
    > weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
    > damage2 = Rand(0, Int(weapon_level))
    > Call DamageNPC(Index, Target, Damage + damage2)
    > Else
    > Call DamageNPC(Index, Target, Damage)
    > End If
    > Call WeaponSkill(Index)
    > End If
    > End If
    > End Sub

    NewChar script

    > ' Executes when a new character is created.
    > Sub OnNewChar(Index, CharNum)
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "sword" "1")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "sword_exp" "0")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "2hsword" "1")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "2hsword_exp" "0")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "mace" "1")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "mace_exp" "0")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "staff" "1")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "staff_exp" "0")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "dagger" "1")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "dagger_exp" "0")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "throwing" "1")
    > Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "throwing_exp" "0")
    > End Sub

    The character file

    > [WEAPONS]
    > sword=3
    > sword_exp=0
    > 2hsword=3
    > 2hsword_exp=0
    > mace=3
    > mace_exp=0
    > staff=3
    > staff_exp=0
    > dagger=3
    > dagger_exp=0
    > throwing=3
    > throwing_exp=0

    Weapons File

    > '[1] = weapon slot (ex. 12:  Small Sword means you put [12])
    > [1]
    > weapon_name=Sword
    > weapon_type=sword
    > [4]
    > weapon_name=God Sword
    > weapon_type=sword
    > [6]
    > weapon_name=Clerics Rod
    > weapon_type=mace
    > [7]
    > weapon_name=Wizards Staff
    > weapon_type=staff
    > [16]
    > weapon_name=Small Sword
    > weapon_type=sword
    > [27]
    > weapon_name=Two Handed Sword
    > weapon_type=2hsword
    > [32]
    > weapon_name=Survival Knife
    > weapon_type=dagger
    > [37]
    > weapon_name=Heavy Two Handed Sword
    > weapon_type=2hsword
    > [41]
    > weapon_name=Knights Sword
    > weapon_type=sword
    > [43]
    > weapon_name=Heavy Blessed Rod
    > weapon_type=mace
    > [45]
    > weapon_name=Jagged Survival Knife
    > weapon_type=dagger
    > [48]
    > weapon_name=Heavy Staff
    > weapon_type=staff
    > [66]
    > weapon_name=New Cleric Weapon
    > weapon_type=mace
    > [69]
    > weapon_name=Ninja Star
    > weapon_type=throwing
    > [70]
    > weapon_name=Wooden Sword
    > weapon_type=sword
    > [71]
    > weapon_name=Hard Wooden Staff
    > weapon_type=staff
    > [72]
    > weapon_name=Flimsy Rod
    > weapon_type=staff
    > [73]
    > weapon_name=Twig
    > weapon_type=dagger
    > [73]
    > weapon_name=Wooden Kunai
    > weapon_type=throwing
    > [80]
    > weapon_name=Shuriken
    > weapon_type=thowing

    And finally the exp file

    > [EXPERIENCE]
    > 1=5
    > 2=7
  3. Everything in there works fine without the decelerations just so you know. Since I don't use any of those variables in the PutVar commands they shouldn't effect it all.

    I still don't see the use of dim when you don't always have to have to make things work as every working script I've made (none of them but the skill script are on here) work without it.
  4. @DarkMazer:

    > I don't really see why there'd be a problem, unless the folder "characters" does not exist inside the folder "scripts"… If it doesn't, add it and try again.
    > If it does, though, try changing:to Same goes for points. 
    >
    > If that doesn't work, just try messing around with it for a while.  I've noticed that the variable never seems to be the right type you want it to be when you're working with PutVar...

    OMG I'm such a n00b sometimes xD that folder is suppose to be charextras xD

    And yes, Call WeaponSkill is a script in progress that I have created.

    EDIT: I have edited the script with your suggestions and still nothing happens
  5. Could anyone tell me why the variables I want put in the .ini file isn't getting put in there? I've made sure the NPC doesn't die when I hit it as that is what I thought the issue was at first but it didn't fix it.

    > ' Executes when a player presses the CONTROL key.
    > Sub OnAttack(Index, Damage)
    > Dim Target
    >
    > If Int(Damage) > 0 Then
    > If Int(GetPlayerTarget(Index)) > 0 Then
    > Target = GetPlayerTarget(Index)
    > map = GetPlayerMap(Index)
    > x = GetNpcX(map, Target)
    > y = GetNpcY(map, Target)
    > Call DamagePlayer(Index, Target, Damage)
    > Call SpellAnim(1, map, x, y)
    > Else
    > Target = GetPlayerTargetNPC(Index)
    > map = GetPlayerMap(Index)
    > x = GetNpcX(map, Target)
    > y = GetNpcY(map, Target)
    > level = GetPlayerLevel(Index)
    > points = GetPlayerPOINTS(Index)
    > Call DamageNPC(Index, Target, Damage)
    > Call SpellAnim(1, map, x, y)
    > Call WeaponSkill(Index)
    > Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "level", "" & level & "")
    > Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "points", "" & points & "")
    > End If
    > End If
    > End Sub

    Thanks, the help is much appreciated!
  6. Not sure, the baron's quest script give them to us like that. I fixed it but still thought you should know.

    BTW: Whenever I use the search button here…I get the same page EVERY TIME that says "No results could be found"
  7. Okay, I was dled the source files and was screwing with them to see what I can do with it in terms of the GUI without editing source code. For some reason, when I press the play test button it says its loading it then VB6 closes and the game never pops up but when I go into my processes in the task panel it shows its still running.

    I figured, I haven't done much to it so lets just re download it and I'll be good. I downloaded it and its a different client and the code is completely different! I was going to adding the press enter to talk code in but when I got this new client the code it looks for doesn't even exist anymore.

    What's version is the download now, lol.
×
×
  • Create New...