Jump to content

Louis T Steinhil

Members
  • Content Count

    172
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Louis T Steinhil


  1. Card Deposit from RO Mobile (via OnPCStatCalcEvent)


    Requirements: (OnPCStatCalcEvent of Annie. I'm using 2.0 version since the 2.1 has bugs when @reloading the command)

    Pro's: Bonus Stats
    Con's: If you are submitting/retrieving cards "if ever a server crash occurred", there's going to be duplication/ rollback on your part because sql doesn't save instant and it requires some time. The only solution is for you to rollback/ update database with your latest backup.

    Warning: OnPCStatCalcEvent seems to be broken on @reloadscript, you'll need to restart the server if you did @reloadscript.

    Feel free to message me if you want to upgrade or optimize the script. I'm more than happy to accept it.

     

    iteminfo.lub

    ----------------------------------------------------------
    ------ rathena
    ------ sader1992
    ------ https://rathena.org/board/profile/30766-sader1992/
    ----------------------------------------------------------
    tbl = {
    	--ADD YOUR ITEMS HERE!!
    	--Example
    	--Card Collector
    	--Alphabetical
    	[4140] = {
    		unidentifiedDisplayName = "Abysmal Knight Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Abysmal Knight Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Increases physical damage inflicted on ^FF0000Boss^000000 monsters by 25%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Increases physical damage inflicted on ^FF0000Boss^000000 monsters by 25%",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4409] = {
    		unidentifiedDisplayName = "Agav Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Agav Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Matk +5%",
    			"DEF -10",
    			"^FFFFFF_^000000",
    			"[ ^6666CCMage Class^000000 ]",
    			"MaxSP +100",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Matk +5%",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4244] = {
    		unidentifiedDisplayName = "Alarm Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Alarm Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Vit +1",
    			"MaxHP +300",
    			"Add the chance of auto casting ^008800Level 1 Sight^000000 around the user when receiving Physical Damage.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCClock Tower Card Set^000000 ]",
    			"^008800Tower Keeper Card^000000",
    			"^008800Punk Card^000000",
    			"^008800Alarm Card^000000",
    			"^008800Clock Card^000000",
    			"Def +3",
    			"Mdef +3",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Vit +1",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Footgear^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4253] = {
    		unidentifiedDisplayName = "Alice Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Alice Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Receive 40% less damage from ^FF0000Boss^000000 monsters.",
    			"Receive 40% more damage from ^FF0000Normal^000000 monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Receive 40% less damage from ^FF0000Boss^000000 monsters.",
    			"^FFFFFF_^000000",			
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4401] = {
    		unidentifiedDisplayName = "Alicel Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "" },
    		identifiedDisplayName = "Alicel Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"FLEE +10",
    			"DEF -5",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"FLEE +10",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},	
    	[4402] = {
    		unidentifiedDisplayName = "Aliot Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Aliot Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"[ ^6666CCSwordman, Merchant, Thief^000000 ]",
    			"Str +2",
    			"MaxHP +5%",
    			"^FFFFFF_^000000",
    			"[ ^6666CCArcher, Acolyte, Mage^000000 ]",
    			"Int +2",
    			"MaxSP +5%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Str +2",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Garment^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4400] = {
    		unidentifiedDisplayName = "Aliza Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Aliza Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Add a 5% chance of autocasting ^008800Charming Wink^000000 each time the wearer is physically attacked.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDancer^000000 ]",
    			"Chance increases to 10%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Add a 5% chance of autocasting ^008800Charming Wink^000000 each time the wearer is physically attacked.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4252] = {
    		unidentifiedDisplayName = "Alligator Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Alligator Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Receive 5% less damage from Long Ranged Physical Attack.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCHunter Card Set^000000 ]",
    			"^008800Cruiser Card^000000",
    			"^008800Anolian Card^000000",
    			"^008800Alligator Card^000000",
    			"^008800Dragon Tail Card^000000",
    			"^008800Merman Card^000000",
    			"+20% Ranged Attack Damage",
    			"Agi +5",
    			"Dex +3",
    			"+20% Seeking Attack",
    			"(which never miss its target)",
    			"^FFFFFF_^000000",
    			"[ ^6666CCArcher Class Bonus^000000 ]",
    			"A low chance of",
    			"auto casting Coma on",
    			"Brute monsters",
    			"when attacking.",
    			"+5% EXP from",
    			"Brute monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCBard/Dancer Card Set^000000 ]",
    			"^008800Cruiser Card^000000",
    			"^008800Anolian Card^000000",
    			"^008800Alligator Card^000000",
    			"^008800Dragon Tail Card^000000",
    			"^008800Green Ferus Card^000000",
    			"Dex +5",
    			"+5% Arrow Vulcan Damage",
    			"+10% Musical Strike Damage",
    			"+10% Throw Arrow Damage",
    			"[ ^6666CCBard/Dancer Bonus^000000 ]",
    			"A low chance of",
    			"auto casting",
    			"level 2 Tarot Card of Fate",
    			"when hit by a melee attack.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Receive 5% less damage from Long Ranged Physical Attack.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^B40088 Accessory^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4245] = {
    		unidentifiedDisplayName = "Am Mut Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Am Mut Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Receive 10% more Experience Points from ^FF0000Demihuman^000000 monsters.",
    			"Receive 20% more damage from ^777777Demihuman^000000 monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Receive 10% more Experience Points from ^FF0000Demihuman^000000 monsters.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Footgear^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4032] = {
    		unidentifiedDisplayName = "Ambernite Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Ambernite Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Def +2",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Def +2",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4236] = {
    		unidentifiedDisplayName = "Amon Ra Card",
    		unidentifiedResourceName = "red",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Amon Ra Card",
    		identifiedResourceName = "red",
    		identifiedDescriptionName = {
    			"All stats +1",
    			"Add the chance of casting ^FF0000Level 10 Kyrie Eleison^000000 around the user when reciving Physical Damage.",
    			"The chance of casting the skill is increased if the user has 99 INT points.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"All stats +1",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Footgear^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4062] = {
    		unidentifiedDisplayName = "Anacondaq Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Anacondaq Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Increases physical damage inflicted on ^FF0000Poison^000000 elemental monsters by 20%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Increases physical damage inflicted on ^FF0000Poison^000000 elemental monsters by 20%.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4387] = {
    		unidentifiedDisplayName = "Ancient Mimic Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Ancient Mimic Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Adds 1 AGI for every 18 points of base LUK.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Adds 1 AGI for every 18 points of base LUK.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4248] = {
    		unidentifiedDisplayName = "Ancient Mummy Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Ancient Mummy Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Add the chance of auto casting ^FF0000Level 5 Signum Crucis^000000 on an enemy when the user receives Physical Damage.",
    			"^FFFFFF_^000000",
    			"+ [ ^6666CCMummy Card^000000 ]",
    			"Perfect Hit + 20.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Add the chance of auto casting ^FF0000Level 5 Signum Crucis^000000 on an enemy when the user receives Physical Damage.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4249] = {
    		unidentifiedDisplayName = "Ancient Worm Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Ancient Worm Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Receive 10% more Experience Points from ^FF0000Demon^000000 monsters.",
    			"Receive 20% more damage from ^FF0000Demon^000000 monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Receive 10% more Experience Points from ^FF0000Demon^000000 monsters.",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Footgear^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4043] = {
    		unidentifiedDisplayName = "Andre Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Andre Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Atk +20",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Atk +20",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4013] = {
    		unidentifiedDisplayName = "Andre Egg Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Andre Egg Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"MaxHP +5%",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"MaxHP +5%",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4018] = {
    		unidentifiedDisplayName = "Andre Larva Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Andre Larva Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Int +1",
    			"MaxSP +10",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Int +1",
    			"^FFFFFF_^000000",
    			"Type:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4054] = {
    		unidentifiedDisplayName = "Angelring Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "" },
    		identifiedDisplayName = "Angelring Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Blesses compounded Armor with the ^FF0000Holy^000000 elemental.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Increase damage on ^FF0000Angel^000000 monsters by 20%.",
    			"^FFFFFF_^000000",
    			"Type: ^777777 Card^000000",
    			"Compound on: ^777777Armor^000000",
    			"Weight: ^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4234] = {
    		unidentifiedDisplayName = "Anolian Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "" },
    		identifiedDisplayName = "Anolian Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Add the chance of auto casting ^008800Level 1 Improve Concentration^000000 on the user when receiving Physical Damage.",
    			"If the user has mastered the skill at level 10, it will cast ^008800Level 10 Improve Concentration^000000.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCHunter Card Set^000000 ]",
    			"^008800Cruiser Card^000000",
    			"^008800Anolian Card^000000",
    			"^008800Alligator Card^000000",
    			"^008800Dragon Tail Card^000000",
    			"^008800Merman Card^000000",
    			"+20% Ranged Attack Damage",
    			"Agi +5",
    			"Dex +3",
    			"+20% Seeking Attack",
    			"(which never miss its target)",
    			"^FFFFFF_^000000",
    			"[ ^6666CCArcher Class Bonus^000000 ]",
    			"A low chance of",
    			"auto casting Coma on",
    			"Brute monsters",
    			"when attacking.",
    			"+5% EXP from",
    			"Brute monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCBard/ Dancer Card Set^000000 ]",
    			"^008800Cruiser Card^000000",
    			"^008800Anolian Card^000000",
    			"^008800Alligator Card^000000",
    			"^008800Dragon Tail Card^000000",
    			"^008800Green Ferus Card^000000",
    			"Dex +5",
    			"+5% Arrow Vulcan Damage",
    			"+10% Musical Strike Damage",
    			"+10% Throw Arrow Damage",
    			"^FFFFFF_^000000",
    			"[ ^6666CCBard or Dancer Bonus^000000 ]",
    			"A low chance of",
    			"auto casting",
    			"level 2 Tarot Card of Fate",
    			"when hit by a melee attack.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Grants Skill Concentration Lv. 1",
    			"^FFFFFF_^000000",
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4344] = {
    		unidentifiedDisplayName = "Anopheles Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Anopheles Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Adds a chance of dropping ^008800Tentacle Cheese Gratin^000000 when defeating Insect monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Adds a chance of dropping ^008800Tentacle Cheese Gratin^000000 when defeating Insect monsters.",
    			"^FFFFFF_^000000",
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Accessory^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4243] = {
    		unidentifiedDisplayName = "Antonio Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Antonio Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Has a high chance of casting ^008800Level 1 Teleport^000000 on the user when taken Physical Damage.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Has a high chance of casting ^008800Level 1 Teleport^000000 on the user when taken Physical Damage.",
    			"^FFFFFF_^000000",			
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4138] = {
    		unidentifiedDisplayName = "Anubis Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Anubis Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Reduces damage taken from ^FF0000Angel^000000 monsters by 30%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Reduces damage taken from ^FF0000Angel^000000 monsters by 30%.",
    			"^FFFFFF_^000000",				
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4242] = {
    		unidentifiedDisplayName = "Apocalipse Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Apocalipse Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Vit +2",
    			"MaxHP +800 if the armor is upgraded up to +9 or higher.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Vit +2",
    			"^FFFFFF_^000000",			
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4443] = {
    		unidentifiedDisplayName = "Aqua Elemental Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Aqua Elemental Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Decreases damage taken from ^0000BBWater^000000 elemental monsters by 20%.",
    			"Increases damage dealt to ^0000BBWater^000000 elemental monsters by 5%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Decreases damage taken from ^0000BBWater^000000 elemental monsters by 20%.",
    			"^FFFFFF_^000000",				
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4241] = {
    		unidentifiedDisplayName = "Arc Angelring Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Arc Angelring Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"MaxHP +300",
    			"When base LUK is 77 or higher: Increases natural HP and SP regeneration by 100%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"MaxHP +300",
    			"^FFFFFF_^000000",			
    			"Class:^777777 Card^000000",
    			"Compound on:^6600FF Headgear^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4371] = {
    		unidentifiedDisplayName = "Archdam Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Archdam Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Atk +10",
    			"Increases cast time by 20%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCCrusader Card Set^000000 ]",
    			"^008800Archdam Card^000000",
    			"^008800Permeter Card^000000",
    			"^008800Freezer Card^000000",
    			"^008800Heater Card^000000",			
    			"Int +1",
    			"Str +1",
    			"Def +2",
    			"SP Recovery +10%",
    			"+10% Shield Chain and",
    			"Sacrifice Damage",
    			"Casting Speed +10%",
    			"[ ^6666CCCrusader/Paladin Only Bonus^000000 ]",
    			"Armor becomes Holy Element.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"MaxHP +300",
    			"^FFFFFF_^000000",
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4094] = {
    		unidentifiedDisplayName = "Archer Skeleton Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Archer Skeleton Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Increases long range physical attacks by 10%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Increases long range physical attacks by 10%.",
    			"^FFFFFF_^000000",			
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4240] = {
    		unidentifiedDisplayName = "Arclouze Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Arclouze Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Def +2 and Mdef +3 if the shield is upgraded no higher than +5.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Def +2 and Mdef +3",
    			"^FFFFFF_^000000",				
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Shield^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4114] = {
    		unidentifiedDisplayName = "Argiope Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Argiope Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Def +1",
    			"Enchants armor with ^663399Poison^000000 elemental.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Def +1",
    			"^FFFFFF_^000000",				
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4075] = {
    		unidentifiedDisplayName = "Argos Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "" },
    		identifiedDisplayName = "Argos Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"DEF +1",
    			"^FFFFFF_^000000",
    			"Increases resistance against ^663399Stone Curse^000000 status by 20%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Def +1",
    			"^FFFFFF_^000000",
    			"^0000CCType:^000000 Card",
    			"^0000CCCompound on:^000000 Shield",
    			"^0000CCWeight:^000000 1"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},	
    	[4347] = {
    		unidentifiedDisplayName = "Armeyer Dinze Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Armeyer Dinze Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Adds a chance of dropping ^008800Clam Soup^000000 when defeating ^777777Fish^000000 monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Adds a chance of dropping ^008800Clam Soup^000000 when defeating ^777777Fish^000000 monsters.",
    			"^FFFFFF_^000000",				
    			"Class:^777777 Card^000000",
    			"Compound on:^B40088 Accessory^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4359] = {
    		unidentifiedDisplayName = "Assassin Cross Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Assassin Cross Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Enables use of Level 3 ^008800Cloaking^000000.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Inflict 50% more damage with Critical attacks",
    			"^FFFFFF_^000000",				
    			"Class:^777777 Card^000000",
    			"Compound on:^008C99 Garment^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4246] = {
    		unidentifiedDisplayName = "Assaulter Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Assaulter Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Increases critical attack damage by 10%.",
    			"Critical +7 on ^777777Demihuman^000000 monsters.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCSwordman Card set^000000 ]",
    			"^008800Assaulter Card^000000",
    			"^008800Permeter Card^000000",
    			"^008800Solider Card^000000",
    			"^008800Freezer Card^000000",
    			"^008800Heater Card^000000",
    			"Str +10",
    			"MaxHP +20%",
    			"Increases HP regen by 50%.",
    			"Randomly autocasts Level 1 ^0000FFWeapon Perfection^000000 when dealing physical attack.",
    			"Randomly a defeated monster will drop ^777777Red Potion^000000.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCSwordman^000000 ]",
    			"Increases restoration gained from ^777777Red Potion^000000, ^777777Yellow Potion^000000 and ^777777White Potion^000000 by 50%.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Inflict 10% more damage with Critical attacks",
    			"^FFFFFF_^000000",	
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4247] = {
    		unidentifiedDisplayName = "Aster Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Aster Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Atk +5",
    			"Inflict 30% more damage on ^777777Shell Fish^000000.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCBeach Card set^000000 ]",
    			"^008800Shell Fish Card^000000",
    			"^008800Crab Card^000000",
    			"^008800Aster Card^000000",
    			"Increases physical damage inflicted on ^0000BBWater^000000 elemental monsters by 30%.",
    			"Randomly a defeated ^777777Fish^000000 monster will drop ^777777Raw Fish^000000.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Atk + 5",
    			"^FFFFFF_^000000",
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4425] = {
    		unidentifiedDisplayName = "Atroce Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "..." },
    		identifiedDisplayName = "Atroce Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"Atk +25",
    			"When in physical attack, Reduces after attack delay by 100% for 10 seconds.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"Atk + 25",
    			"^FFFFFF_^000000",			
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Weapon^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0
    	},
    	[4023] = {
    		unidentifiedDisplayName = "Baby Desert Wolf Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "" },
    		identifiedDisplayName = "Baby Desert Wolf Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"INT +1",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"INT +1",
    			"^FFFFFF_^000000",
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"			
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},
    	[4233] = {
    		unidentifiedDisplayName = "Baby Leopard Card",
    		unidentifiedResourceName = "이름없는카드",
    		unidentifiedDescriptionName = { "" },
    		identifiedDisplayName = "Baby Leopard Card",
    		identifiedResourceName = "이름없는카드",
    		identifiedDescriptionName = {
    			"LUK +3",
    			"^FFFFFF_^000000",
    			"When equipped by ^0033CCMerchant^000000 classes:",
    			"Armor becomes indestructible.",
    			"^FFFFFF_^000000",
    			"When equipped with ^990099Zipper Bear Card^000000, ^990099Raggler Card^000000, ^990099Myst Case Card^000000 and ^990099Heirozoist Card^000000:",
    			"LUK +10",
    			"Increases damage of ^009900Mammonite^000000 by 20%.",
    			"Gains 2 SP on each physical attack.",
    			"When equipped by ^0033CCMerchant^000000 classes:",
    			"Adds 20% chance of reflecting magical attack.",
    			"Random chance a defeated monster will drop ^0033CCOld Purple Box^000000.",
    			"^FFFFFF_^000000",
    			"When equipped with ^990099Zipper Bear Card^000000, ^990099Raggler Card^000000, ^990099Muka Card^000000 and ^990099Holden Card^000000:",
    			"STR +4",
    			"MaxHP +7%",
    			"MaxSP +7%",
    			"Increases damage of ^009900Mammonite^000000 by 20%.",
    			"Gains 1 SP on each physical attack.",
    			"^FFFFFF_^000000",
    			"When equipped by ^0033CCAlchemist^000000 classes:",
    			"Random chance to auto-cast Level 1 ^009900Adrenaline Rush^000000 when dealing physical attacks.",
    			"Random chance a defeated monster will drop ^0033CCGlistening Coat^000000 or ^0033CCStem^000000.",
    			"^FFFFFF_^000000",
    			"[ ^6666CCDesposit Reward^000000 ]",
    			"LUK +3",			
    			"^FFFFFF_^000000",
    			"Class:^777777 Card^000000",
    			"Compound on:^777777 Armor^000000",
    			"Weight:^777777 1^000000"
    		},
    		slotCount = 0,
    		ClassNum = 0,
    		costume = false,
    		EffectID = 1186
    	},	
    }

    OnPCStatCalcEvent.conf

    //================= Hercules Configuration ================================
    //=       _   _                     _
    //=      | | | |                   | |
    //=      | |_| | ___ _ __ ___ _   _| | ___  ___
    //=      |  _  |/ _ \ '__/ __| | | | |/ _ \/ __|
    //=      | | | |  __/ | | (__| |_| | |  __/\__ \
    //=      \_| |_/\___|_|  \___|\__,_|_|\___||___/
    //================= License ===============================================
    //= This file is part of Hercules.
    //= http://herc.ws - http://github.com/HerculesWS/Hercules
    //=
    //= Copyright (C) 2014-2024 Hercules Dev Team
    //=
    //= Hercules is free software: you can redistribute it and/or modify
    //= it under the terms of the GNU General Public License as published by
    //= the Free Software Foundation, either version 3 of the License, or
    //= (at your option) any later version.
    //=
    //= This program is distributed in the hope that it will be useful,
    //= but WITHOUT ANY WARRANTY; without even the implied warranty of
    //= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    //= GNU General Public License for more details.
    //=
    //= You should have received a copy of the GNU General Public License
    //= along with this program.  If not, see <http://www.gnu.org/licenses/>.
    //=========================================================================
    //= Hercules Sockets local configuration file
    //=========================================================================
    
    script: (
    { // npc/custom/xxxevent.txt
    OnPCStatCalcEvent:
        <"
    		if (@Knight_Of_Abyss_Card) {
    			bonus2 bAddClass, Class_Boss, 25;
    		}
    		if (@Agav_Card) {
    			bonus bMatkRate, 5;
    		}
    		if (@Alarm_Card) {
    			bonus bVit, 1;
    		}
    		if (@Alice_Card) {
    			bonus2 bSubClass, Class_Boss, 40;
    		}
    		if (@Alicel_Card) {
    			bonus bFlee, 10;
    		}
    		if (@Aliot_Card) {
    			bonus bStr, 2;
    		}
    		if (@Aliza_Card) {
    			bonus3 bAutoSpellWhenHit, "DC_WINKCHARM", 1, 50;
    		}
    		if (@Alligator_Card) {
    			bonus bLongAtkDef, 5;
    		}
    		if (@Am_Mut_Card) {
    			bonus2 bExpAddRace, RC_DemiHuman, 10;
    		}
    		if (@Ambernite_Card) {
    			bonus bDef, 1;
    		}
    		if (@Amon_Ra_Card) {
    			bonus bAllStats, 1;
    		}
    		if (@Anacondaq_Card) {
    			bonus2 bAddEle, Ele_Poison, 20;
    		}
    		if (@Ancient_Mimic_Card) {
    			bonus bAgi, readparam(bLuk)/18;
    		}
    		if (@Ancient_Mummy_Card) {
    			bonus3 bAutoSpellWhenHit, "AL_CRUCIS", 5, 30;
    		}
    		if (@Ancient_Worm_Card) {
    			bonus2 bExpAddRace, RC_Demon, 10;
    		}
    		if (@Andre_Card) {
    			bonus bBaseAtk, 20;
    		}
    		if (@Andre_Egg_Card) {
    			bonus bMaxHPrate, 5;
    		}
    		if (@Andre_Larva_Card) {
    			bonus bInt, 1;
    		}
    		if (@Angeling_Card) {
    			bonus2 bAddRace, RC_Angel, 20;
    		}
    		if (@Anolian_Card) {
    			skill "AC_CONCENTRATION", 1;
    		}
    		if (@Anopheles_Card) {
    			bonus3 bAddMonsterDropItem, 12058, RC_Insect, 50;
    		}
    		if (@Antonio_Card) {
    			bonus3 bAutoSpellWhenHit, "AL_TELEPORT", 1, 500;
    		}
    		if (@Anubis_Card) {
    			bonus2 bSubRace, RC_Angel, 30;
    		}
    		if (@Apocalips_Card) {
    			bonus bVit, 2;
    		}
    		if (@Aqua_Elemental_Card) {
    			bonus2 bSubEle, Ele_Water, 20;
    		}
    		if (@Archangeling_Card) {
    			bonus bMaxHP, 300;
    		}
    		if (@Archdam_Card) {
    			bonus bBaseAtk, 10;
    		}
    		if (@Archer_Skeleton_Card) {
    			bonus bLongAtkRate, 10;
    		}
    		if (@Arclouse_Card) {
    			bonus bDef, 2; 
    			bonus bMdef, 3;
    		}
    		if (@Argiope_Card) {
    			bonus bDef, 1;
    		}
    		if (@Argos_Card) {
    			bonus2 bResEff, Eff_Stone, 20;
    		}
    		if (@Armaia_Card) {
    			bonus3 bAddMonsterDropItem, 12053, RC_Fish, 50;
    		}
    		if (@B_Eremes_Card) {
    			bonus bCritAtkRate, 50;
    		}
    		if (@Assulter_Card) {
    			bonus bCritAtkRate, 10;
    		}
    		if (@Aster_Card) {
    			bonus bBaseAtk, 5;
    		}
    		if (@Atroce_Card) {
    			bonus bBaseAtk, 25;
    		}
    		if (@Desert_Wolf_Babe_Card) {
    			bonus bInt, 1;
    		}		
    		if (@Baby_Leopard_Card) {
    			bonus bLuk, 3;
    		}
        end;
        ">
    },
    
    )

     


     


  2. Endless Tower Instance with Difficulties


    A small tweak on Endless Tower Instance.

    Increases Monsters HP, Attack, Def/Mdef, Flee and Hit per difficulty.

    Rewards Instance Points Easy, Vet, Nightmare, Hell & Torment.

    Generates Alias to monsters if you're on different difficulty.

    Added Emistry's Currency Shop

     

    Note: You are going to experience this since there's a limit on setunitdata.
    image.png.6c9d9053b0a46c89cdadb3c7def32511.png

    The workaround to this is:

    find this in setunitdata (src/map/script.c)
     

    	case UDT_STR:
    	case UDT_AGI:
    	case UDT_VIT:
    	case UDT_INT:
    	case UDT_DEX:
    	case UDT_LUK:
    	case UDT_STATPOINT:
    	case UDT_ATKRANGE:
    	case UDT_ATKMIN:
    	case UDT_ATKMAX:
    	case UDT_MATKMIN:
    	case UDT_MATKMAX:
    	case UDT_AMOTION:
    	case UDT_ADELAY:
    	case UDT_DMOTION:
    		//setunitdata_check_bounds(4, 0, USHRT_MAX); <---comment out then add
    		setunitdata_check_min(4, 0);
    		break;
    	case UDT_DEF:

     

     

    EndlessTower.txt


     


  3. 2 hours ago, KirieZ said:

    Yes, you are right about the cause.

     

    Your case seems to be causing a similar effect of a server crash, when it gets terminated in an abnormal situation.

     

    I am not sure if there is really something that can be done in this case... while you could create a script command to force saving the character data for this case, you would still have it open for others.

     

    I think the best option would be to:

    1. When doing a production server normal shutdown, always do it properly. Kick all players (even better: do something to prevent them from logging back in) and wait some time (I think ~5 minutes would be more than enough).

        I think if map server is shut down separately first, it will send all data to char, but this is something that would need to be done manually

    2. If there was a server crash, which could cause those dupes, you probably need to either review your logs of the last few minutes and check if actions are needed, or rollback to a recent backup if you think it would be safer

    Okay, thanks for the response. I was really curious if anyone has done something to prevent it but i guess rollback is really the answer, of course besides kicking them manually. XD


  4. I am trying to make a script called Card Collection NPC all is working now but the main problem I'm encountering is when I submit the card it will give the bonus stats in return. I will immediately close the server via console without letting the character logout so now I got 20 Abysmal Knight Card which should be 10 only because I already submitted it. I use only setd / getd in storing variables. And I get the part why it's duplicating because there's a delay in saving data to sql right? So how do I prevent this?

     

    Untitled.jpg


  5. 7 hours ago, KirieZ said:

    The error is due to the main NPC not being in a map. As it is not in a map, Herc most likely didn't initialize unit data for it (since it would be useless).

     

    Either put it in a map or add a check to not apply unitdata for it. Here is how to do the 2nd option:

    OnInit: if (strnpcinfo(NPC_MAP) == "") // Not in a map, can't set view data end; setunitdata(getnpcid(), UDT_GROUP, 1); setunittitle(getnpcid(), "Goddess Statue"); end;

    
    OnInit:
    	if (strnpcinfo(NPC_MAP) == "") // Not in a map, can't set view data
    		end;
    
    	setunitdata(getnpcid(), UDT_GROUP, 1);
    	setunittitle(getnpcid(), "Goddess Statue");
    	end;

     

    Oh thanks man, this works. Now every duplicate has group and title.


  6. On 1/12/2015 at 9:56 PM, Dastgir said:

     

    thumb-5682b59e7f9a13880cf7e48c3b2c0ab7-screenhercules017.jpg

     

     

    File Name: Duplicate NPC Commands

    File Submitter: Dastgir

    File Submitted: 12 Jan 2015

    File Category: Plugins

     

    2 Self Explanatory Commands:

    duplicatenpc("NpcName", "DuplicateName", "DupHiddenName", "map", x, y, dir{, sprite{, xs, ys}});duplicateremove({"NPCname"});

    
    duplicatenpc("NpcName", "DuplicateName", "DupHiddenName", "map", x, y, dir{, sprite{, xs, ys}});duplicateremove({"NPCname"});
     

     

     

    Example Script:

    prontera,150,150,5 script DupTest 999,{mes strnpcinfo(0);close;OnInit:duplicatenpc(strnpcinfo(0),"Duplicated","","prontera",150,148,5,998);end;OnWhisperGlobal:duplicateremove();}

    
    prontera,150,150,5	script	DupTest	999,{mes strnpcinfo(0);close;OnInit:duplicatenpc(strnpcinfo(0),"Duplicated","","prontera",150,148,5,998);end;OnWhisperGlobal:duplicateremove();}
     

     

    ^ Above script will self-duplicate itself with name "Duplicated" to prontera,150,148 with Sprite ID 998, and upon whispering to any of those npc, the duplicate will be removed.

     

     

    Requested by GMOcean @ http://herc.ws/board/topic/7718-duplicatenpc-duplicateremove/?view=getnewpost

     

    Click here to download this file

    Hello, I tested this on the latest hercules. It has error

    image.png.173576644725bf88356a372926a13878.png


  7. 7 hours ago, KirieZ said:

    what if you simply use "getnpcid()" without the NPC name? or use the full name. I am assuming your duplicates have a hidden or unique name added to them, so this getnpcid is not picking it and all of them are targeting the main one.

     

    Try to either use just "getnpcid()" (which should target the current NPC), or if this doesn't work, use strnpcinfo to get the full name instead of the display name

    I get this error when i set it to

    OnInit:
    	setunitdata( getnpcid(), UDT_GROUP, 21);
    	setunittitle( getnpcid(), "Goddess Statue" );
    	end;

    image.png.16f9276831c9af7e4fdf6ee0bbe56365.png

     

    then:

    image.png.50639581ef812851e4d31fd1b7935bfc.png

    OnInit:
    	setunitdata( strnpcinfo(1), UDT_GROUP, 21);
    	setunittitle( strnpcinfo(1), "Goddess Statue" );
    	end;

    Whole script:

    //===== Hercules Script ======================================
    //= [ Heal & Buffs ]
    //===== By: ==================================================
    //= Euphy
    //===== Current Version: =====================================
    //= 1.2
    //===== Description: =========================================
    //= Basic [ Heal & Buffs ] script.
    //===== Additional Comments: =================================
    //= 1.0 Initial script.
    //= 1.1 Aligned coordinates with @go.
    //= 1.2 Fix variables and character stuck at healing
    //============================================================
    
    -	script	Healer	FAKE_NPC,{
    
    	.@price = 0;	// Zeny required for heal
    	.@Buffs = 1;	// Also buff players? (1: yes / 0: no)
    	.@Delay = 5;	// Heal delay, in seconds
    
    	if (@HD > gettimetick(GETTIMETICK_UNIXTIME)) {
    		end;
    	}
    	if (.@price) {
    		message strcharinfo(PC_NAME),"Healing costs "+.@price+" Zeny.";
    		if (Zeny < .@price) end;
    		if(select("^0055FFHeal^000000", "^777777Cancel^000000") == 2) close;
    		Zeny -= .@price;
    	}
    	specialeffect(EF_HEAL2, AREA, playerattached()); percentheal 100,100;
    	if (.@Buffs) {
    		specialeffect(EF_INCAGILITY, AREA, playerattached()); sc_start SC_INC_AGI,240000,10;
    		specialeffect(EF_BLESSING, AREA, playerattached()); sc_start SC_BLESSING,240000,10;
    	}
    	if (.@Delay) {
    		@HD = gettimetick(GETTIMETICK_UNIXTIME) + .@Delay;
    	}
    	end;
    OnInit:
    	setunitdata( strnpcinfo(1), UDT_GROUP, 21);
    	setunittitle( strnpcinfo(1), "Goddess Statue" );
    	end;	
    }
    
    
    // Duplicates
    //============================================================
    alberta,25,240,6	duplicate(Healer)	Healer#alb	4_F_08_STATUE
    aldebaran,135,118,6	duplicate(Healer)	Healer#alde	4_F_08_STATUE
    amatsu,200,79,4	duplicate(Healer)	Healer#ama	4_F_08_STATUE
    ayothaya,207,169,6	duplicate(Healer)	Healer#ayo	4_F_08_STATUE
    comodo,184,158,6	duplicate(Healer)	Healer#com	4_F_08_STATUE
    einbech,57,36,6	duplicate(Healer)	Healer#einbe	4_F_08_STATUE
    einbroch,57,202,6	duplicate(Healer)	Healer#einbr	4_F_08_STATUE
    geffen,115,72,6	duplicate(Healer)	Healer#gef	4_F_08_STATUE
    gonryun,156,122,6	duplicate(Healer)	Healer#gon	4_F_08_STATUE
    hugel,89,150,6	duplicate(Healer)	Healer#hug	4_F_08_STATUE
    izlude,125,118,5	duplicate(Healer)	Healer#izl	4_F_08_STATUE
    jawaii,250,139,4	duplicate(Healer)	Healer#jaw	4_F_08_STATUE
    lighthalzen,152,100,6	duplicate(Healer)	Healer#lhz	4_F_08_STATUE
    louyang,226,103,4	duplicate(Healer)	Healer#lou	4_F_08_STATUE
    manuk,272,144,6	duplicate(Healer)	Healer#man	4_F_08_STATUE
    mid_camp,203,289,6	duplicate(Healer)	Healer#mid	4_F_08_STATUE
    moc_ruins,72,164,4	duplicate(Healer)	Healer#moc	4_F_08_STATUE
    morocc,153,97,6	duplicate(Healer)	Healer#mor	4_F_08_STATUE
    moscovia,220,191,4	duplicate(Healer)	Healer#mos	4_F_08_STATUE
    niflheim,212,182,5	duplicate(Healer)	Healer#nif	4_F_08_STATUE
    payon,179,106,4	duplicate(Healer)	Healer#pay	4_F_08_STATUE
    prontera,162,193,4	duplicate(Healer)	Healer#prt	4_F_08_STATUE
    rachel,125,116,6	duplicate(Healer)	Healer#rac	4_F_08_STATUE
    splendide,201,153,4	duplicate(Healer)	Healer#spl	4_F_08_STATUE
    thor_camp,249,74,4	duplicate(Healer)	Healer#thor	4_F_08_STATUE
    umbala,105,148,3	duplicate(Healer)	Healer#umb	4_F_08_STATUE
    veins,217,121,4	duplicate(Healer)	Healer#ve	4_F_08_STATUE
    xmas,143,136,4	duplicate(Healer)	Healer#xmas	4_F_08_STATUE
    yuno,164,45,4	duplicate(Healer)	Healer#yuno	4_F_08_STATUE
    
    // Duplicates (Renewal)
    //============================================================
    brasilis,194,221,6	duplicate(Healer)	Healer#bra	4_F_08_STATUE
    dewata,195,187,4	duplicate(Healer)	Healer#dew	4_F_08_STATUE
    dicastes01,201,194,4	duplicate(Healer)	Healer#dic	4_F_08_STATUE
    ecl_in01,45,60,4	duplicate(Healer)	Healer#ecl	4_F_08_STATUE
    malangdo,132,114,6	duplicate(Healer)	Healer#mal	4_F_08_STATUE
    malaya,205,205,6	duplicate(Healer)	Healer#ma	4_F_08_STATUE
    mora,55,152,4	duplicate(Healer)	Healer#mora	4_F_08_STATUE
    t_garden,123,121,4	duplicate(Healer)	Healer#tgarden	4_F_08_STATUE
    

     


  8. you can find this in mapzone. Let us know also if it's working like gvg or not. I am interested also

     

    Heracles-master\db\re

    {
    	/* CvC zone is applied to all maps with a cvc mapflag */
    	name: "CvC" /* changing this name requires MAP_ZONE_CVC_NAME to also be changed in src/map/map.h file */
    
    	disabled_skills: {
    		BS_GREED: "PLAYER"
    		CG_HERMODE: "PLAYER"
    	}
    
    	disabled_items: {
    		Greed_Scroll: true
    		C_Beginner_Cap: true
    	}
    
    	/* cashshop disabled in cvc maps */
    	mapflags: (
    		"nocashshop",
    	)
    },

     


  9. nvm, I fixed mine.

     

    hello can anyone help me decode which part when I relogin/logout the OnPCStatCalcEvent bonus stats disappear? I want to turn that off.

     

    //===== Hercules Plugin ======================================
    //= OnPCStatCalcEvent
    //===== By: ==================================================
    //= AnnieRuru
    //= originally by QQfoolsorellina
    //===== Current Version: =====================================
    //= 2.0
    //===== Compatible With: ===================================== 
    //= Hercules 2020-11-12
    //===== Description: =========================================
    //= give player permanent bonus
    //===== Topic ================================================
    //= http://herc.ws/board/topic/11292-onpcstatcalcevent/
    //===== Additional Comments: =================================  
    //= fix `*skill` doesn't work correctly by using an external file
    //============================================================
    
    #include "common/hercules.h"
    #include "map/pc.h"
    #include "map/script.h"
    #include "map/status.h"
    #include "common/conf.h"
    #include "common/memmgr.h"
    #include "plugins/HPMHooking.h"
    #include "common/HPMDataCheck.h"
    
    HPExport struct hplugin_info pinfo = {
    	"OnPCStatCalcEvent",
    	SERVER_TYPE_MAP,
    	"2.0",
    	HPM_VERSION,
    };
    
    VECTOR_DECL(struct script_code *)statcalcevent;
    
    int read_onpcstatcalcevent(void) {
    	const char *confpath = "conf/import/OnPCStatCalcEvent.conf";
    	struct config_t onpcstatcalcevent_conf;
    	if (!libconfig->load_file(&onpcstatcalcevent_conf, confpath)) {
    		ShowError("can't read %s, file not found !\n", confpath);
    		return -1;
    	}
    
    	struct config_setting_t *config_db = libconfig->setting_get_member(onpcstatcalcevent_conf.root, "script");
    	if (config_db == NULL) {
    		ShowError("can't read %s\n", confpath);
    		libconfig->destroy(&onpcstatcalcevent_conf);
    		return -1;
    	}
    
    	struct config_setting_t *config = NULL;
    	int i = 0;
    	struct script_code *tmp;
    	const char *string = NULL;
    	VECTOR_INIT(statcalcevent);
    	while ((config = libconfig->setting_get_elem(config_db, i++))) {
    		if (libconfig->setting_lookup_string(config, "OnPCStatCalcEvent", &string)) {
    			tmp = script->parse(string, "OnPCStatCalcEvent", 0, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL);
    			VECTOR_ENSURE(statcalcevent, 1, 1);
    			VECTOR_PUSH(statcalcevent, tmp);
    		}
    		else
    			ShowError("Invalid Type on entry no."CL_WHITE"%d"CL_RESET" in '"CL_WHITE"%s"CL_RESET"'.\n", i, confpath);
    	}
    
    //	ShowDebug("%d\n", VECTOR_LENGTH(statcalcevent));
    //	for (i = 0; i < VECTOR_LENGTH(statcalcevent); i++) {
    //		ShowDebug("%s\n", VECTOR_INDEX(statcalcevent, i));
    //		ShowDebug("%s\n", VECTOR_INDEX(statcalcevent, i)->script_buf);
    //	}
    
    	libconfig->destroy(&onpcstatcalcevent_conf);
    	ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", VECTOR_LENGTH(statcalcevent), confpath);
    	return VECTOR_LENGTH(statcalcevent);
    }
    
    void status_calc_pc_additional_post(struct map_session_data *sd, enum e_status_calc_opt opt) {
    	if (sd == NULL)
    		return;
    	for (int i = 0; i < VECTOR_LENGTH(statcalcevent); i++)
    		script->run(VECTOR_INDEX(statcalcevent, i), 0, sd->bl.id, 0);
    	return;
    }
    
    BUILDIN(recalculatestat) {
    	struct map_session_data *sd;
    	if (script_hasdata(st,2)) {
    		if (data_isstring(script_getdata(st,2)))
    			sd = map->nick2sd(script_getstr(st,2), true);
    		else
    			sd = map->id2sd(script_getnum(st,2));
    	}
    	else
    		sd = script->rid2sd(st);
    	if (sd)
    		status_calc_pc(sd, SCO_FORCE);
    	return true;
    }
    
    void clean_onpcstatcalcevent(void) {
    	for (int i = 0; i < VECTOR_LENGTH(statcalcevent); ++i) {
    		VECTOR_CLEAR(VECTOR_INDEX(statcalcevent, i)->script_buf);
    		aFree(VECTOR_INDEX(statcalcevent, i));
    	}
    	VECTOR_CLEAR(statcalcevent);
    	return;
    }
    
    int script_reload_post(int retVal) {
    	clean_onpcstatcalcevent();
    	read_onpcstatcalcevent();
    	return retVal;
    }
    
    HPExport void plugin_init(void) {
    	addHookPost(status, calc_pc_additional, status_calc_pc_additional_post);
    	addScriptCommand("recalculatestat", "?", recalculatestat);
    	addHookPost(script, reload, script_reload_post);
    }
    
    HPExport void server_online(void) {
    	read_onpcstatcalcevent();
    }
    
    HPExport void plugin_final(void) {
    	clean_onpcstatcalcevent();
    }

  10. 10 hours ago, KirieZ said:

    How are you setting the title/group for the first one? OnInit should be called in every duplicate, so you could just use it to set the title/group

    Ah it's different, okay thanks for the advice!

    I set the title group like this.

    OnInit:
    	setunitdata( getnpcid("[ Heal & Buffs ]"), UDT_GROUP, 21);
    	setunittitle( getnpcid("[ Heal & Buffs ]"), "Goddess Statue" );
    	end;

     


  11. I think I got it now. Thanks!

    screenHercules002.thumb.jpg.cf0fa16ffa7d1a039aabebeaacfacf97.jpg

     

    freeloop(true);	
    	// Summon mobs and store their IDs
    	for (.@i = 0; .@i < .@amount; .@i++) {
    		.@mobGID = areamonster(.@map$, .@x1, .@y1, .@x2, .@y2, .@mob_name$, .@mob_id, 1, .@label$);
    
    			.@MAXHP = getunitdata(.@mobGID, UDT_MAXHP);
    			.@HP = getunitdata(.@mobGID, UDT_HP);
    			setunitdata(.@mobGID, UDT_MAXHP, .@MAXHP + ((.@MAXHP * .@bonus_hp_rate) / 100));
    			setunitdata(.@mobGID, UDT_HP, .@HP + ((.@HP * .@bonus_hp_rate) / 100));
    			
    			.@ATKMIN = getunitdata(.@mobGID, UDT_ATKMIN);
    			.@ATKMAX = getunitdata(.@mobGID, UDT_ATKMAX);
    			setunitdata(.@mobGID, UDT_ATKMIN, .@ATKMIN + ((.@ATKMIN * .@bonus_dmg_rate) / 100));
    			setunitdata(.@mobGID, UDT_ATKMAX, .@ATKMAX + ((.@ATKMAX * .@bonus_dmg_rate) / 100));
    
    			.@DAMAGETAKEN = getunitdata(.@mobGID, UDT_DAMAGE_TAKEN_RATE);
    			setunitdata(.@mobGID, UDT_DAMAGE_TAKEN_RATE, .@DAMAGETAKEN + ((.@DAMAGETAKEN * .@bonus_damagetaken) / 100));
    
    			.@DEF = getunitdata(.@mobGID, UDT_DEF);
    			setunitdata(.@mobGID, UDT_DEF, .@DEF + ((.@DEF * .@bonus_def) / 100));
    
    			.@MDEF = getunitdata(.@mobGID, UDT_MDEF);
    			setunitdata(.@mobGID, UDT_MDEF, .@MDEF + ((.@MDEF * .@bonus_mdef) / 100));
    
    			.@HIT = getunitdata(.@mobGID, UDT_HIT);
    			setunitdata(.@mobGID, UDT_HIT, .@HIT + ((.@HIT * .@bonus_hit) / 100));
    
    			.@FLEE = getunitdata(.@mobGID, UDT_FLEE);
    			setunitdata(.@mobGID, UDT_FLEE, .@FLEE + ((.@FLEE * .@bonus_flee) / 100));	
    
    	}
    freeloop(false);

     


  12. 11 hours ago, KirieZ said:

    I am not sure what exactly is wrong, but as far as I can tell, this code doesn't make much sense... I have only skimmed through the initial part, but:

     

    $@mobid is an empty array, and is being copied into .@GID (Thus, .@GID would be an array too?), but then .@GID is passed to getunitdata, which doesn't expect an array... and getunitdata result is not used at all..

     

    So I am really not sure what it is trying to do

    Sorry wasn't aware that $@mobid[] was not available in herc. 
     

    Returned value is an array with the game ID of the spawned monster(s) depending
    on the amount spawned. Array is stored in $@mobid[].

     


  13. On 6/29/2024 at 7:30 AM, KirieZ said:

    I think your options are:

    1. Recreate the script command in herc, shouldn't be that hard, I believe this info is available, just need to make a script command to get it

     

     

    2. Save a dynamic global variable using the instance ID as suffix using setd between instance_create and instance_init. Once the instance starts, you can copy the value from the global variable into an instance variable. Something like that:

    // create instance .@instanceId = instance_create(...) // Make global var setd(sprintf("$@instance_type_%d", .@instanceId), 1 /* whatever you need to store */); // Init it instance_init(...) // ------ // This is called on instance_init OnInstanceInit: .@varName$ = sprintf("$@instance_type_%d", instance_id()); 'instanceType = getd(.@varName$); setd(.@varName$, 0); // Clean up so you don't mess up future id reuses end;

    
    // create instance
    .@instanceId = instance_create(...)
    
    // Make global var
    setd(sprintf("$@instance_type_%d", .@instanceId), 1 /* whatever you need to store */);
    
    // Init it
    instance_init(...)
    
    // ------
    
    // This is called on instance_init
    OnInstanceInit:
    	.@varName$ = sprintf("$@instance_type_%d", instance_id());
    	'instanceType = getd(.@varName$);
    	setd(.@varName$, 0); // Clean up so you don't mess up future id reuses
    	end;

     

    References:

    - OnInstanceInit: https://github.com/HerculesWS/Hercules/blob/stable/doc/script_commands.txt#L1151

    - instance_create: https://github.com/HerculesWS/Hercules/blob/stable/doc/script_commands.txt#L9730

    - instance_init: https://github.com/HerculesWS/Hercules/blob/stable/doc/script_commands.txt#L9793

     

     

    This seems to be okay but i got an error on getunitdata.
     

     setd("$ENDLESSMODE[" + .@instance + "]", .@level_mode);                
    dispbottom "Choice: " + getd("$ENDLESSMODE[" + .@instance + "]");

    OnInstanceInit:
        .@level_mode = getd("$ENDLESSMODE[" + instance_id() + "]");
        'level_mode = .@level_mode; 

     

    function	script	F_Tower_Monster_Summon	{
    	.@map$ = getarg(0, "");
    	.@x1 = getarg(1, 0);
    	.@y1 = getarg(2, 0);
    	.@x2 = getarg(3, 0);
    	.@y2 = getarg(4, 0);
    	.@mob_name$ = getarg(5, "");
    	.@mob_id = getarg(6, 0);
    	.@amount = getarg(7, 0);
    	.@label$ = getarg(8, "");
    
    	switch('level_mode){
    		case 1://Normal
    			.@bonus_hp_rate += 0;
    			.@bonus_dmg_rate += 0;
    			.@bonus_damagetaken += 0;
    			.@bonus_def += 0;
    			.@bonus_mdef += 0;
    			.@bonus_hit += 0;			
    			.@bonus_flee += 0;
    			break;
    		case 2://Veteran
    			.@bonus_hp_rate += 40;
    			.@bonus_dmg_rate += 40;
    			.@bonus_damagetaken += -10;
    			.@bonus_def += 40;
    			.@bonus_mdef += 40;
    			.@bonus_hit += 40;			
    			.@bonus_flee += 40;		
    			break;
    		case 3://Nightmare
    			.@bonus_hp_rate += 80;
    			.@bonus_dmg_rate += 80;
    			.@bonus_damagetaken += -20;
    			.@bonus_def += 80;
    			.@bonus_mdef += 80;
    			.@bonus_hit += 80;			
    			.@bonus_flee += 80;					
    			break;
    		case 4://Hell
    			.@bonus_hp_rate += 100;
    			.@bonus_dmg_rate += 100;
    			.@bonus_damagetaken += -30;
    			.@bonus_def += 100;
    			.@bonus_mdef += 100;
    			.@bonus_hit += 100;			
    			.@bonus_flee += 100;			
    			break;
    		case 5://Torment
    			.@bonus_hp_rate += 200;
    			.@bonus_dmg_rate += 200;
    			.@bonus_damagetaken += -40;
    			.@bonus_def += 200;
    			.@bonus_mdef += 200;
    			.@bonus_hit += 200;			
    			.@bonus_flee += 200;				
    			break;
    	}
    	deletearray $@mobid,getarraysize($@mobid);
    	areamonster .@map$, .@x1, .@y1, .@x2, .@y2, .@mob_name$, .@mob_id, .@amount, .@label$;
    	copyarray .@GID, $@mobid, getarraysize($@mobid);
    	if(!.@bonus_hp_rate&& !.@bonus_dmg_rate&& !.@bonus_damagetaken&& !.@bonus_def&& !.@bonus_mdef&& !.@bonus_hit&& !.@bonus_flee)
    		return;
    	getunitdata .@GID, .@ST;
    
    	if(.@bonus_hp_rate){
    		.@HP = .@ST[UDT_MAXHP] + ((.@ST[UDT_MAXHP] * .@bonus_hp_rate ) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){			
    			setunitdata(.@GID[.@i], UDT_MAXHP, .@HP);
    			setunitdata(.@GID[.@i], UDT_HP, .@HP);
    		}
    	}
    	if(.@bonus_dmg_rate){
    		.@ATKMIN = .@ST[UDT_ATKMIN] + ((.@ST[UDT_ATKMIN] * .@bonus_dmg_rate) /100);
    		.@ATKMAX = .@ST[UDT_ATKMAX] + ((.@ST[UDT_ATKMAX] * .@bonus_dmg_rate) /100);
    		.@MATKMIN = .@ST[UDT_MATKMIN] + ((.@ST[UDT_MATKMIN] * .@bonus_dmg_rate) /100);
    		.@MATKMAX = .@ST[UDT_MATKMAX] + ((.@ST[UDT_MATKMAX] * .@bonus_dmg_rate) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){
    			setunitdata(.@GID[.@i], UDT_ATKMIN, .@ATKMIN);
    			setunitdata(.@GID[.@i], UDT_ATKMAX, .@ATKMAX);
    			setunitdata(.@GID[.@i], UDT_MATKMIN, .@MATKMIN);
    			setunitdata(.@GID[.@i], UDT_MATKMAX, .@MATKMAX);
    		}
    	}
    	if(.@bonus_damagetaken){
    		.@DAMAGETAKEN = .@ST[UDT_DAMAGE_TAKEN_RATE] + ((.@ST[UDT_DAMAGE_TAKEN_RATE] * .@bonus_damagetaken) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){		
    			setunitdata(.@GID[.@i], UDT_DAMAGE_TAKEN_RATE, .@DAMAGETAKEN);
    		}
    	}
    	if(.@bonus_def){
    		.@DEF = .@ST[UDT_DEF] + ((.@ST[UDT_DEF] * .@bonus_def) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){		
    			setunitdata(.@GID[.@i], UDT_DEF, .@DEF);
    		}
    	}	
    	if(.@bonus_mdef){
    		.@MDEF = .@ST[UDT_MDEF] + ((.@ST[UDT_MDEF] * .@bonus_mdef) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){		
    			setunitdata(.@GID[.@i], UDT_MDEF, .@MDEF);
    		}
    	}
    	if(.@bonus_hit){
    		.@HIT = .@ST[UDT_HIT] + ((.@ST[UDT_HIT] * .@bonus_hit) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){		
    			setunitdata(.@GID[.@i], UDT_HIT, .@HIT);
    		}
    	}		
    	if(.@bonus_flee){
    		.@FLEE = .@ST[UDT_FLEE] + ((.@ST[UDT_FLEE] * .@bonus_flee) /100);
    		for(.@i=0;.@i<getarraysize(.@GID);.@i++){		
    			setunitdata(.@GID[.@i], UDT_FLEE, .@FLEE);
    		}
    	}
    	return;
    }

    Error:
     

    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): #1F Controller at 0001@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): #1F Controller at 0001@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): #1F Controller at 0001@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): #1F Controller at 0001@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): #1F Controller at 0001@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): #1F Controller at 0001@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#1 at 0002@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#1 at 0002@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#1 at 0002@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#1 at 0002@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#1 at 0002@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#2 at 0003@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#2 at 0003@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#2 at 0003@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#3 at 0004@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#3 at 0004@tower (29,365)
    [Warning]: buildin_getunitdata: Error in finding object with given GID 0!
    [Debug]: Source (NPC): Immortal Furnace#3 at 0004@tower (29,365)

     


  14. Hello guys anyone can help me with this script? I'm converting my endless tower from rAthena to Hercules. Since we don't have this what should I use instead?

    *instance_live_info(<info type>{,<instance id>});
    
    Returns the specified <info type> of instance attached to the npc or, if
    an instance ID is specified, of that instance.
    
    Valid <info type>:
    ILI_NAME	- Instance Name
    			  Return the name of the instance or "" if that fails.
    ILI_MODE	- Instance Mode
    			  Return IM_NONE, IM_CHAR, IM_PARTY, IM_GUILD, IM_CLAN or -1 if that fails.
    ILI_OWNER	- Owner ID
    			  Return an ID according to the instance mode of the instance attached/specified or -1 if that fails.
    			  When the instance mode is IM_NONE, ILI_OWNER will return the npc ID that created the instance,
    			  IM_CHAR	- the owner char ID
    			  IM_PARTY	- the party ID
    			  IM_GUILD	- the guild ID
    			  IM_CLAN	- the clan ID
    
    Examples:
    	// Return the instance name of the instance attached to the npc.
    	.@instance_name$ = instance_live_info(ILI_NAME);
    
    	// Return the guild owner ID of the given instance ID.
    	.@owner = instance_live_info(ILI_OWNER, instance_id(IM_GUILD));

    This part links the value of what the player chose so it would supply the data if it's easy / hard etc.

    1@tower,29,365,1	script	#1F Controller	844,{
    	end;
    
    OnInstanceInit:
    	'level_mode = $ENDLESSMODE[instance_live_info(ILI_OWNER)]; <----
    
    	callfunc "F_Tower_Monster",1,instance_mapname("1@tower"),instance_npcname("#1F Controller")+"::OnMyMobDead";

    https://rathena.org/board/topic/133368-quests-games-endless-tower-instance-with-difficulty/


  15. Hello i have code here from cydh that changes the players race, this is working on rAthena. Although it's not compatible with herc. Anyone can help me with it? Thanks!


    https://www.dropbox.com/scl/fi/msiy4c6fu5uwok1e0fhtx/bonus_bRace.diff?rlkey=4c41esca9fewia9n8uartp0jd&e=1&dl=0
     

    doc/item_bonus.txt           | 1 +
     src/map/map.hpp              | 1 +
     src/map/pc.cpp               | 4 ++++
     src/map/pc.hpp               | 1 +
     src/map/script_constants.hpp | 1 +
     src/map/status.cpp           | 5 +++++
     6 files changed, 13 insertions(+)
    
    diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt
    index 7ffe172b5..08ef4a571 100644
    --- a/doc/item_bonus.txt
    +++ b/doc/item_bonus.txt
    @@ -260,6 +260,7 @@ Atk/Def
     -------
     bonus bAtkEle,e;          		Gives the player's attacks element e
     bonus bDefEle,e;          		Gives the player's defense element e
    +bonus bRace,r;          		Set the player's race to race r
     
     bonus2 bMagicAtkEle,e,x;  		Increases damage of e element magic by x%
     
    diff --git a/src/map/map.hpp b/src/map/map.hpp
    index 5200ff6b4..44073fbb2 100644
    --- a/src/map/map.hpp
    +++ b/src/map/map.hpp
    @@ -429,6 +429,7 @@ enum _sp {
     
     	// Mercenaries
     	SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190,
    +	SP_RACE,
     
     	// original 1000-
     	SP_ATTACKRANGE=1000,	SP_ATKELE,SP_DEFELE,	// 1000-1002
    diff --git a/src/map/pc.cpp b/src/map/pc.cpp
    index ab1040eca..be3d1cdee 100755
    --- a/src/map/pc.cpp
    +++ b/src/map/pc.cpp
    @@ -3217,6 +3217,10 @@ void pc_bonus(struct map_session_data *sd,int type,int val)
     			if (sd->state.lr_flag != 2)
     				sd->special_state.no_mado_fuel = 1;
     			break;
    +		case SP_RACE:
    +			PC_BONUS_CHK_RACE(val, SP_RACE);
    +			sd->bonus.change_race = (enum e_race)val;
    +			break;
     		default:
     			if (running_npc_stat_calc_event) {
     				ShowWarning("pc_bonus: unknown bonus type %d %d in OnPCStatCalcEvent!\n", type, val);
    diff --git a/src/map/pc.hpp b/src/map/pc.hpp
    index 05e861c64..dfebca1d9 100644
    --- a/src/map/pc.hpp
    +++ b/src/map/pc.hpp
    @@ -497,6 +497,7 @@ struct map_session_data {
     		int ematk; // matk bonus from equipment
     		int eatk; // atk bonus from equipment
     		uint8 absorb_dmg_maxhp; // [Cydh]
    +		enum e_race change_race;
     		short critical_rangeatk;
     		short weapon_atk_rate, weapon_matk_rate;
     	} bonus;
    diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp
    index 5d5066a4e..2c8a2f0e9 100644
    --- a/src/map/script_constants.hpp
    +++ b/src/map/script_constants.hpp
    @@ -731,6 +731,7 @@
     	export_constant2("bRegenPercentHP", SP_REGEN_PERCENT_HP);
     	export_constant2("bRegenPercentSP", SP_REGEN_PERCENT_SP);
     	export_constant2("bSkillDelay",SP_SKILL_DELAY);
    +	export_constant2("bRace", SP_RACE);
     
     	/* equip indices */
     	export_constant(EQI_COMPOUND_ON);
    diff --git a/src/map/status.cpp b/src/map/status.cpp
    index d08be8e81..67546d1c2 100644
    --- a/src/map/status.cpp
    +++ b/src/map/status.cpp
    @@ -3495,6 +3495,7 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt)
     	);
     
     	memset (&sd->bonus, 0, sizeof(sd->bonus));
    +	sd->bonus.change_race = RC_NONE_;
     
     	// Autobonus
     	pc_delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),true);
    @@ -4208,6 +4209,10 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt)
     		if (sc->data[SC_LAUDARAMUS])
     			sd->bonus.crit_atk_rate += 5 * sc->data[SC_LAUDARAMUS]->val1;
     	}
    +
    +	if (sd->bonus.change_race != RC_NONE_)
    +		base_status->race = sd->bonus.change_race;
    +
     	status_cpy(&sd->battle_status, base_status);
     
     // ----- CLIENT-SIDE REFRESH -----

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.