-
Posts
232 -
Joined
-
Last visited
-
Days Won
7 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Cataclismo
-
-
I had this problem too. I fixed it by making my itemshop compatible with the game.
There are 2 types of limit:
1. Limit based on worn time
2. Limit based on real time
The second limit type can be only used with REAL_TIME flag, but the first one can be used with flag and also if the item has ITEM_UNIQUE type.
If the item has type ITEM_UNIQUE, the REAL_TIME flag won't work!
-
Points are not updated. Probably because of PointsPacket() or something.
-
This is an english forum and we kinda expect english content. Also, why I saw some romanian translations like "Te-ai consolidat cu o forta magica" and the blacksmith chat?
Also, you probably missed the effect packet. Check how potions works with effects.
-
Flags and proper socket value.
-
That's not a bug. That's normal.
File: char_item.cpp
Function:
bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell)
The code:
if (iWearCell != WEAR_ARROW && (dwCurTime - GetLastAttackTime() <= 1500 || dwCurTime - m_dwLastSkillTime <= 1500)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°¡¸¸È÷ ÀÖÀ» ¶§¸¸ Âø¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.")); return false; }
You should not edit it. I think this code has his own role.
-
_mob_spawn: _mob_spawn: wrong mapindex same error
Hmm... that's weird. Are you sure you're not CH99 and you copied new code from above and compiled the source? Check it.
-
mob_spawn(2493, 475, 709, 41)
mob x y MAP_INDEX BLUE
_mob_spawn: _mob_spawn: wrong mapindex
Oops. My bad. I edited the code from previous post. Check it out.
-
Right click on "EterPack" project and click "Rebuild". This may help.
-
File: questlua_global.cpp
Find :
void RegisterGlobalFunctionTable(lua_State* L)
and above this function add:
// mob_spawn(vnum, x, y, map_index) int _mob_spawn(lua_State* L) { if (lua_gettop(L) < 4) { sys_err("_mob_spawn: not enough arguments"); lua_pushboolean(L, 0); return 1; } if(false == lua_isnumber(L, 1) || false == lua_isnumber(L, 2) || false == lua_isnumber(L, 3) || false == lua_isnumber(L, 4)) { sys_err("_mob_spawn: invalid arguments"); lua_pushboolean(L, 0); return 1; } const DWORD dwVnum = static_cast<DWORD>(lua_tonumber(L, 1)); const long lX = static_cast<long>(lua_tonumber(L, 2)); const long lY = static_cast<long>(lua_tonumber(L, 3)); const long lMapIndex = static_cast<long>(lua_tonumber(L, 4)); const CMob* pMonster = CMobManager::instance().Get(dwVnum); if (!pMonster) { sys_err("_mob_spawn: wrong vnum"); lua_pushboolean(L, 0); return 1; } LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(lMapIndex); if (!pkSectreeMap) { sys_err("_mob_spawn: wrong mapindex"); lua_pushboolean(L, 0); return 1; } LPCHARACTER mob = CHARACTER_MANAGER::instance().SpawnMob(dwVnum, lMapIndex, lX, lY, 0); if (!mob) { sys_err("_mob_spawn: mob not spawned; coords maybe wrong?"); lua_pushboolean(L, 0); return 1; } lua_pushboolean(L, 1); return 1; }
Now search for
{ "spawn_mob", _spawn_mob },
And add after:
{ "mob_spawn", _mob_spawn },
And you call it like this:
mob_spawn(vnum, x, y, map_index)
The function returns true/false if mob was called or not.
Also, if the mob is not called then it will display an error in your syserr file:
"_mob_spawn: not enough arguments" -- you called the function with fewer arguments
"_mob_spawn: invalid arguments" -- you passed an wrong arguments. all must be numbers
"_mob_spawn: wrong vnum" -- you provided wrong mob vnum
"_mob_spawn: wrong mapindex" -- you provided wrong map index
"_mob_spawn: mob not spawned; coords maybe wrong?" -- mob could not be spawned. this may happen if the coords are wrong- 1
-
Automated Hide&Seek event using source:
Automated fishing event using source:
You can do it via timed events on source (search for event_create and event_cancel) or by quest using server timers -
Hi Guys, I change the item_name, item_proto, mob_proto and mob_name in the serverfiles, but now when I start the server show me "Connection Refused".. Help
They have mistakes.
In the folder where your db core is located you have a file called syserr. In this file you can find almost everytime the source of your problem. You probably never looked in it and you deleted it everytime. Stop doing this. Are very, very important those files for finding the source of your problems. Everytime when something is not working check these files and you may find where's your problem.
Delete it (if you didn't already), and open your db core. Wait until your db core closes (because it will) and then read syserr.
PS: I recommend you to delete it because it's easier to find the problems when the files are small and your errors are writed only once.
-
Automatic HnS by source:
Wtf ??
Huh? I did automatic HnS on source. More fun.
-
Automatic HnS by source:
-
You get skills from a NPC? If yes, check your quests for that NPC.
-
input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 8 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 9 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 10 has type 'long int' input_db.cpp:2839: warning: too few arguments for format
Change from %u to %lu for arguments 8, 9 and 10 (count them). Also, I think you provided less arguments than it needs.
input_main.cpp:3374: error: duplicate case value input_main.cpp:3301: error: previously used here
You have used case SOMETHING: more than just one time (available for all errors you get!).
You used on line 3301 and also on line 3374. Use them just once. If you used them just once then the values are the same even the name are not. You should provide unique numbers for each (in packet.h). If you change their values make sure you do that in client too.
-
Because there are a lot of stupid players.
If you do a classic and old style server they're like "What do you have special? You just copied finalongju" and if you do a server with some new systems they're like "This is not metin2 anymore".
But there are old style servers. I don't know how was the server you mentioned, but I think they're close.
-
First of all, ask your questions here next time..
About your problem, it seems you included utils.h more than just one time and your functions are redefined.
Open utils.h and in top of the file, before everything else, add this:
#pragma once
If this does not work you should check your code for duplicate include.
- 2
-
Next time, use Questions and Answers forum, please.
I think you want to change hit damage bonus on items. You can do that by editing file item_addon.cpp
// SKILL BONUS: int iSkillBonus = MINMAX(-30, (int) (gauss_random(0, 5) + 0.5f), 30); // HIT BONUS (based on skill bonus) int iNormalHitBonus = 0; if (abs(iSkillBonus) <= 20) iNormalHitBonus = -2 * iSkillBonus + abs(number(-8, 8) + number(-8, 8)) + number(1, 4); else iNormalHitBonus = -2 * iSkillBonus + number(1, 5);
For item bonuses search in char_item.cpp
case USE_ADD_ATTRIBUTE :
and replace this
if (item2->GetAttributeCount() < 4)
with this
if (item2->GetAttributeCount() < 5)
Good luck.
-
File name: char_skill.cpp
Function:
void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
Search this:
switch (GetSkillMasterType(pkSk->dwVnum)) { case SKILL_NORMAL: if (GetSkillLevel(pkSk->dwVnum) >= 17) { if (GetQuestFlag("reset_scroll.force_to_master_skill") > 0) { SetSkillLevel(pkSk->dwVnum, 20); SetQuestFlag("reset_scroll.force_to_master_skill", 0); } else { if (number(1, 21 - MIN(20, GetSkillLevel(pkSk->dwVnum))) == 1) SetSkillLevel(pkSk->dwVnum, 20); } } break;
And replace it with this:
switch (GetSkillMasterType(pkSk->dwVnum)) { case SKILL_NORMAL: if (GetSkillLevel(pkSk->dwVnum) >= 17) { SetSkillLevel(pkSk->dwVnum, 20); sys_log(0, "FORCE MASTER: %u", pkSk->dwVnum); } break;
-
File name: char_skill.php
Function:
bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)
Find this:
int need_bookcount = GetSkillLevel(dwSkillVnum) - 20;
and change it to:
int need_bookcount = 0;
Have fun.
- 1
-
My code does not affect alignment. I think that's your own problem.
-
I don't know how this system works, but I think you can work around by yourself because I don't see anyone to post it for free.
I will give you a few details, but I can't make the code for you right now because I am busy.
This is my own "work around". Is not the right method, but that's all I got.
Attention!: This is NOT tested and I don't guarantee that this works. Use with care.
This is just for testing purposes only. NEVER do it in live version.
First of all, your item need the type ITEM_USE, and the subtype USE_SPECIAL.
Now open common/length.h and find
enum EWearPositions
and before
WEAR_MAX = 32
add
WEAR_SHOULDER = YOUR_SLOT,
YOUR_SLOT must be the one you have in client.
In char_item.cpp, in UseItemEx function find this:
case USE_SPECIAL: switch (item->GetVnum()) {
and right after it put this code:
case CODE1: case CODE2: case CODE3: { if (!item->IsEquipped()) { if (!CanEquipNow(item)) { ChatPacket(CHAT_TYPE_INFO, "You can't equip this object."); return false; } else { return item->EquipTo(this, WEAR_SHOULDER); } } else { if (!CanUnequipNow(item)) { ChatPacket(CHAT_TYPE_INFO, "You can't unequip this object."); return false; } else { return UnequipItem(item); } } }
Replace CODE1, CODE2, CODE3 with your items code.
- 3
-
Ok , now it's work only if i have this items in inventory but if they are equipped they don't drop....
And also i have problem, after compilation the game with this function , when i write /kill <player name> and this player is online i have crash core(ch1_core1)
Oh, you want equipment too. I didn't know.
About the command, yeah, probably because the pkKiller parameter is not set. I fixed that too.
Here's the code:
if (pkKiller && IsPC()) { if (GetMapIndex() == YOUR_MAPINDEX && pkKiller->IsPC()) { PIXEL_POSITION pos; pos.x = GetX(); pos.y = GetY(); for (WORD i = 0; i < INVENTORY_MAX_NUM + WEAR_MAX_NUM; ++i) { LPITEM item = GetInventoryItem(i); if (item) { switch (item->GetVnum()) { case 1: case 2: case 3: case 4: case 5: { SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255); item->RemoveFromCharacter(); item->AddToGround(GetMapIndex(), pos, true); item->StartDestroyEvent(); } break; } } } } }
- 1
-
i will try , thx
EDIT:
At compilation i have this...
char_battle.cpp: In member function 'void CHARACTER::Dead(CHARACTER*, bool)': char_battle.cpp:1302: error: expected primary-expression before ')' token compile cmd_emotion.cpp compile cmd_general.cpp gmake: *** [OBJDIR/char_battle.o] Error 1 gmake: *** Waiting for unfinished jobs....
Ooops. I writed the code wrong. I edited my previous post so you can copy again the code.
- 1
[Q] Server_timer
in Community Support - Questions & Answers
Posted
Why you need the player name to be the name for your server timer? Do you want to use it? Or what?