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

Variable items??


vicho815
 Share

Recommended Posts

dunno if that's the name but I wanted to know how to do this… (or just tell me where do I need to look in the code)

instead of making a Light Cape and a speed scroll, and ALSO make a Light Cape +1 Speed, how can I do to make only the first two items and the upgraded item is made by the engine but it isn't stored in the items folder? cuz if I wan't to make it so u can upgrade ur sword till +10, then I'll have to do 11 items for EACH sword xD! plz help me...
Link to comment
Share on other sites

lol I don't thing u can do it with the source…

I DON'T want to make a +1 sword, a +2 sword, a +3 sword etc... that's easy and can be done with sadscript but that's not what I want, I wan't it possible to make a unique item by convining with other items but not making the final item do u understand me now??
Link to comment
Share on other sites

@AkselJ:

> It can be only one item with SadScript, too.

but you can make multiple scripts for weapons

@Ninja-Tech:

> maybe make this a skill?
> you can consider it crafting

this should be possible
crafting
have 2 items
sword and fire ability
sword + fire ability = fire sword

have fire sword a new item
and just have an item for every upgrade
Link to comment
Share on other sites

no xDD u don't understand what I want to do…

I know it's easy to make a  sword and a "fire scroll" and combine them and make a fire sword... but u should also have to do the fire sword, that would be easy... but if I want to make a "+50 strenght Sword" with strength scrolls, then Id have to do a +1 strength sword, a +2 strength sword etc etc... and I want to make every item unique so a player can do a "+1 speed +3 strength +4 magic Sword" imagine the time it would take me to do aaaall the combinations possible...
Link to comment
Share on other sites

@vicho815:

> no xDD u don't understand what I want to do…
>
> I know it's easy to make a   sword and a "fire scroll" and combine them and make a fire sword... but u should also have to do the fire sword, that would be easy... but if I want to make a "+50 strenght Sword" with strength scrolls, then Id have to do a +1 strength sword, a +2 strength sword etc etc... and I want to make every item unique so a player can do a "+1 speed +3 strength +4 magic Sword" imagine the time it would take me to do aaaall the combinations possible...

lol Oooooh
ok well i think that be bessed with the scource…not sure tho
custom windows alongside otehr scripts
Link to comment
Share on other sites

```
Sub UpgradeWep(Index, WepItemNum, UpgradeItemNum, UpgradeType)
Dim WeaponUpgrades
Dim WeaponSTRAdd
Dim WeaponDEFAdd
Dim WeaponSpeedAdd
Dim WeaponMagicAdd
WeaponUpgrades = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponUpgrades", WepItemNum) + 1
WeaponSTRAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponSTR", WepItemNum)
WeaponDEFAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponDEF", WepItemNum)
WeaponSpeedAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponSpeed", WepItemNum)
WeaponMagicAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponMagic", WepItemNum)

If UpgradeType = STR Then
WeaponSTRAdd = WeaponSTRAdd + 1
End If
If UpgradeType = DEF Then
WeaponDEFAdd = WeaponDEFAdd + 1
End If
If UpgradeType = Speed Then
WeaponSpeedAdd = WeaponSpeedAdd + 1
End If
If UpgradeType = Magic Then
WeaponMagicAdd = WeaponMagicAdd + 1
End If

Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponSTR", WepItemNum, WeaponSTRAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponDEF", WepItemNum, WeaponDEFAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponSpeed", WepItemNum, WeaponSpeedAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponMagic", WepItemNum, WeaponMagicAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "StatsAdded", "No")
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "STRAdded", "0")
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "DEFAdded", "0")
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "SpeedAdded", "0")
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "MagicAdded", "0")
Call TakeItem(Index, UpgradeItemNum)

End Sub

```
In Sub OnAttack add:

```
Dim Weapon
Dim STRAdd
Dim DEFAdd
Dim SpeedAdd
Dim MagicAdd
Weapon = Int(GetPlayerInvItemNum(Index, Int(GetPlayerWeaponSlot(index))))
STRAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponSTR", Weapon)
DEFAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponDEF", Weapon)
SpeedAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponSpeed", Weapon)
MagicAdd = GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponMagic", Weapon)

If GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "StatsAdded") = "Yes" Then

Else
Call SetPlayerSTR(Index, GetPlayerSTR(Index) + STRAdd)
Call SetPlayerDEF(Index, GetPlayerDEF(Index) + DEFAdd)
Call SetPlayerSpeed(Index, GetPlayerSpeed(Index) + SpeedAdd)
Call SetPlayerMagic(Index, GetPlayerMagic(Index) + MagicAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "StatsAdded", "Yes")
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "STRAdded", STRAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "DEFAdded", DEFAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "SpeedAdded", SpeedAdd)
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "MagicAdded", MagicAdd)
End If

```
In Sub LeftGame Add:

```
Call PutVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "StatsAdded", "No")
Call SetPlayerSTR(Index, GetPlayerSTR(Index) - GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "STRAdded"))
Call SetPlayerDEF(Index, GetPlayerDEF(Index) - GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "DEFAdded"))
Call SetPlayerSpeed(Index, GetPlayerSpeed(Index) - GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "SpeedAdded"))
Call SetPlayerMagic(Index, GetPlayerMagic(Index) - GetVar("\scripts\charextras\" & GetPlayerName & ".ini", "WeaponAdd", "MagicAdded"))

```
MUST HAVE SUB TAKEITEM TO WORK!

To make upgrade item:
Make Scripted item, make it Call UpgradeWep(Index, WepItemNum, UpgradeItemNum, UpgradeType).
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...