Hatte mal den gleichen Fehler als meine ride quest fehlerhaft war.
Eventuell mal checken.
Beiträge von Muratmolly
-
-
Fehler gefunden, nen teil in der lenght.h vergessen.
-
Common->Service.h vergessen. Musst dort __SKILLS_LEVEL_OVER_P__ definieren
Ist bereits definiert, daran kanns nicht liegen .
Mfg. -
Hey Com,
ich habe versucht Skills über P einzufügen .
Clientsource ohne Probleme, nun striked mein Gamesource rum.
Eventuell könnt ihr mir ja helfen .Bitte melden Sie sich an, um dieses Bild zu sehen.
Char_skill.cpp
Code- void CHARACTER::SetSkillLevel(DWORD dwVnum, BYTE bLev)
- {
- if (NULL == m_pSkillLevels)
- return;
- if (dwVnum >= SKILL_MAX_NUM)
- {
- sys_err("vnum overflow (vnum %u)", dwVnum);
- return;
- }
- m_pSkillLevels[dwVnum].bLevel = MIN(SKILL_MAX_LEVEL, bLev);
- #ifdef __SKILLS_LEVEL_OVER_P__
- if (bLev >= 50)
- m_pSkillLevels[dwVnum].bMasterType = SKILL_SAGE_MASTER;
- else if (bLev >= 40)
- #else
- if (bLev >= 40)
- #endif
- m_pSkillLevels[dwVnum].bMasterType = SKILL_PERFECT_MASTER;
- else if (bLev >= 30)
- m_pSkillLevels[dwVnum].bMasterType = SKILL_GRAND_MASTER;
- else if (bLev >= 20)
- m_pSkillLevels[dwVnum].bMasterType = SKILL_MASTER;
- else
- m_pSkillLevels[dwVnum].bMasterType = SKILL_NORMAL;
- }
Lieben Gruß
Mur -
Danke sehr
-
Ja dann evtl. in einer Ihrer Klassen von der sie erbt. InstanceBase z.B.
Wenn du Schulterband mit Scale einbaust, bezweilfe ich dass du keine SetScale Funktion hinzugefügt hast
Ich kann ohne den Code vor Augen zu haben auch nicht mehr tun als dir die Errors zu erklärenHab jetzt mal den Source nach der SetScale funktion durforstet . -> 3 Treffer.
GrpObjectInstance.cpp
#include "StdAfx.h"
#include "GrpObjectInstance.h"
#include "../eterBase/Timer.h"void CGraphicObjectInstance::OnInitialize()
{
ZeroMemory(m_abyPortalID, sizeof(m_abyPortalID));
}void CGraphicObjectInstance::Clear()
{
if (m_CullingHandle)
{
CCullingManager::Instance().Unregister(m_CullingHandle);
m_CullingHandle = NULL;
}ClearHeightInstance();
m_isVisible = TRUE;
m_v3Position.x = m_v3Position.y = m_v3Position.z = 0.0f;
m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 0.0f;
//m_fRotation = 0.0f;
m_fYaw = m_fPitch = m_fRoll = 0.0f;
D3DXMatrixIdentity(&m_worldMatrix);
#ifdef ENABLE_OBJ_SCALLING
m_v3ScalePosition.x = m_v3ScalePosition.y = m_v3ScalePosition.z = 0.0f;
D3DXMatrixIdentity(&m_ScaleMatrix);
D3DXMatrixIdentity(&m_PositionMatrix);
D3DXMatrixIdentity(&m_TransformMatrix);
#endifZeroMemory(m_abyPortalID, sizeof(m_abyPortalID));
OnClear();
}bool CGraphicObjectInstance::Render()
{
/*
if (m_CullingHandle)
{
SpherePack * ps = m_CullingHandle->GetParent();
CScreen s;
s.SetColorOperation();
//s.SetDiffuseColor(1,isShow()?1:0,0);
//s.RenderCircle2d(m_CullingHandle->GetCenter().x,m_CullingHandle->GetCenter().y,m_CullingHandle->GetCenter().z,m_CullingHandle->GetRadius());
s.SetDiffuseColor(1,isShow()?1:0,ps->HasSpherePackFlag(SPF_PARTIAL)?1:0);
s.RenderCircle2d(ps->GetCenter().x,ps->GetCenter().y,ps->GetCenter().z,ps->GetRadius());
}
//*/
if (!isShow())
return false;OnRender();
return true;
}void CGraphicObjectInstance::BlendRender()
{
if (!isShow())
return;OnBlendRender();
}void CGraphicObjectInstance::RenderToShadowMap()
{
if (!isShow())
return;OnRenderToShadowMap();
}void CGraphicObjectInstance::RenderShadow()
{
if (!isShow())
return;OnRenderShadow();
}void CGraphicObjectInstance::RenderPCBlocker()
{
if (!isShow())
return;OnRenderPCBlocker();
}void CGraphicObjectInstance::Update()
{
OnUpdate();UpdateBoundingSphere();
}void CGraphicObjectInstance::Deform()
{
if (!isShow())
return;OnDeform();
}void CGraphicObjectInstance::Transform()
{
#ifndef ENABLE_OBJ_SCALLING
m_worldMatrix = m_mRotation;
m_worldMatrix._41 += m_v3Position.x;
m_worldMatrix._42 += m_v3Position.y;
m_worldMatrix._43 += m_v3Position.z;
#else
D3DXMATRIX tmp1;
D3DXMatrixMultiply(&tmp1, &m_PositionMatrix, &m_mRotation);
m_worldMatrix = tmp1;
m_worldMatrix._41 += m_v3Position.x;
m_worldMatrix._42 += m_v3Position.y;
m_worldMatrix._43 += m_v3Position.z;
D3DXMatrixMultiply(&tmp1, &m_PositionMatrix, &m_ScaleMatrix);
D3DXMATRIX tmp2;
D3DXMatrixMultiply(&tmp2, &tmp1, &m_mRotation);
m_TransformMatrix = tmp2;
m_TransformMatrix._41 = m_v3ScalePosition.x + m_v3Position.x + m_TransformMatrix._41;
m_TransformMatrix._42 = m_v3ScalePosition.y + m_v3Position.y + m_TransformMatrix._42;
m_TransformMatrix._43 = m_v3ScalePosition.z + m_v3Position.z + m_TransformMatrix._43;
#endif
}const D3DXVECTOR3 & CGraphicObjectInstance::GetPosition() const
{
return m_v3Position;
}const D3DXVECTOR3 & CGraphicObjectInstance::GetScale() const
{
return m_v3Scale;
}float CGraphicObjectInstance::GetRotation()
{
return GetRoll();
}float CGraphicObjectInstance::GetYaw()
{
return m_fYaw;
}float CGraphicObjectInstance::GetPitch()
{
return m_fPitch;
}float CGraphicObjectInstance::GetRoll()
{
return m_fRoll;
}D3DXMATRIX & CGraphicObjectInstance::GetTransform()
{
return m_worldMatrix;
}void CGraphicObjectInstance::SetRotationQuaternion(const D3DXQUATERNION &q)
{
D3DXMatrixRotationQuaternion(&m_mRotation, &q);
}void CGraphicObjectInstance::SetRotationMatrix(const D3DXMATRIX & m)
{
m_mRotation = m;
}void CGraphicObjectInstance::SetRotation(float fRotation)
{
m_fYaw = 0;
m_fPitch = 0;
m_fRoll = fRotation;D3DXMatrixRotationZ(&m_mRotation, D3DXToRadian(fRotation));
}void CGraphicObjectInstance::SetRotation(float fYaw, float fPitch, float fRoll)
{
//m_fRotation = fRotation;
m_fYaw = fYaw;
m_fPitch = fPitch;
m_fRoll = fRoll;D3DXMatrixRotationYawPitchRoll(&m_mRotation, D3DXToRadian(fYaw), D3DXToRadian(fPitch), D3DXToRadian(fRoll));
}void CGraphicObjectInstance::SetPosition(float x, float y, float z)
{
m_v3Position.x = x;
m_v3Position.y = y;
m_v3Position.z = z;
}void CGraphicObjectInstance::SetPosition(const D3DXVECTOR3 & newposition)
{
m_v3Position = newposition;
}#ifdef ENABLE_OBJ_SCALLING
void CGraphicObjectInstance::SetScalePosition(float x, float y, float z)
{
m_v3ScalePosition.x = x;
m_v3ScalePosition.y = y;
m_v3ScalePosition.z = z;
}void CGraphicObjectInstance::SetScale(float x, float y, float z, bool bScaleNow)
#else
void CGraphicObjectInstance::SetScale(float x, float y, float z)
#endif
{
m_v3Scale.x = x;
m_v3Scale.y = y;
m_v3Scale.z = z;
#ifdef ENABLE_OBJ_SCALLING
if (bScaleNow)
D3DXMatrixScaling(&m_ScaleMatrix, m_v3Scale.x, m_v3Scale.y, m_v3Scale.z);
#endif
}void CGraphicObjectInstance::Show()
{
m_isVisible = true;
}void CGraphicObjectInstance::Hide()
{
m_isVisible = false;
}
bool CGraphicObjectInstance::isShow()
{
return m_isVisible;
}//
//////////////////////////////////////////////////////////////////////////
D3DXVECTOR4 & CGraphicObjectInstance::GetWTBBoxVertex(const unsigned char & c_rucNumTBBoxVertex)
{
return m_v4TBBox[c_rucNumTBBoxVertex];
}bool CGraphicObjectInstance::isIntersect(const CRay & c_rRay, float * pu, float * pv, float * pt)
{
D3DXVECTOR3 v3Start, v3Dir;
float fRayRange;
c_rRay.GetStartPoint(&v3Start);
c_rRay.GetDirection(&v3Dir, &fRayRange);TPosition posVertices[8];
posVertices[0] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMin.y, m_v3TBBoxMin.z);
posVertices[1] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMin.y, m_v3TBBoxMin.z);
posVertices[2] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMax.y, m_v3TBBoxMin.z);
posVertices[3] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMax.y, m_v3TBBoxMin.z);
posVertices[4] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMin.y, m_v3TBBoxMax.z);
posVertices[5] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMin.y, m_v3TBBoxMax.z);
posVertices[6] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMax.y, m_v3TBBoxMax.z);
posVertices[7] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMax.y, m_v3TBBoxMax.z);TIndex Indices[36] = {0, 1, 2, 1, 3, 2,
2, 0, 6, 0, 4, 6,
0, 1, 4, 1, 5, 4,
1, 3, 5, 3, 7, 5,
3, 2, 7, 2, 6, 7,
4, 5, 6, 5, 7, 6};int triCount = 12;
WORD* pcurIdx = (WORD*)Indices;while (triCount--)
{
if (IntersectTriangle(v3Start, v3Dir,
posVertices[pcurIdx[0]],
posVertices[pcurIdx[1]],
posVertices[pcurIdx[2]],
pu, pv, pt))
{
return true;
}pcurIdx += 3;
}
return false;
}CGraphicObjectInstance::CGraphicObjectInstance()
{
m_CullingHandle = 0;
Initialize();
}void CGraphicObjectInstance::Initialize()
{
if (m_CullingHandle)
CCullingManager::Instance().Unregister(m_CullingHandle);
m_CullingHandle = 0;m_pHeightAttributeInstance = NULL;
m_isVisible = TRUE;m_BlockCamera = false;
m_v3Position.x = m_v3Position.y = m_v3Position.z = 0.0f;
m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 0.0f;
#ifdef ENABLE_OBJ_SCALLING
m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 0.0f;
#else
m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 1.0f;
#endif
m_fYaw = m_fPitch = m_fRoll = 0.0f;D3DXMatrixIdentity(&m_worldMatrix);
D3DXMatrixIdentity(&m_mRotation);
#ifdef ENABLE_OBJ_SCALLING
m_v3ScalePosition.x = m_v3ScalePosition.y = m_v3ScalePosition.z = 0.0f;
D3DXMatrixIdentity(&m_ScaleMatrix);
D3DXMatrixIdentity(&m_PositionMatrix);
D3DXMatrixIdentity(&m_TransformMatrix);
#endif
OnInitialize();
}CGraphicObjectInstance::~CGraphicObjectInstance()
{
Initialize();
}void CGraphicObjectInstance::UpdateBoundingSphere()
{
if (m_CullingHandle)
{
Vector3d center;
float radius;
GetBoundingSphere(center,radius);
if (radius != m_CullingHandle->GetRadius())
m_CullingHandle->NewPosRadius(center,radius);
else
m_CullingHandle->NewPos(center);
}
}void CGraphicObjectInstance::RegisterBoundingSphere()
{
if (m_CullingHandle)
CCullingManager::Instance().Unregister(m_CullingHandle);m_CullingHandle = CCullingManager::Instance().Register(this);
}void CGraphicObjectInstance::AddCollision(const CStaticCollisionData * pscd, const D3DXMATRIX* pMat)
{
m_StaticCollisionInstanceVector.push_back(CBaseCollisionInstance::BuildCollisionInstance(pscd, pMat));
}void CGraphicObjectInstance::ClearCollision()
{
CCollisionInstanceVector::iterator it;
for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
{
(*it)->Destroy();
}
m_StaticCollisionInstanceVector.clear();
}bool CGraphicObjectInstance::CollisionDynamicSphere(const CDynamicSphereInstance & s) const
{
CCollisionInstanceVector::const_iterator it;
for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
{
if ((*it)->CollisionDynamicSphere(s))
return true;
}
return false;
}bool CGraphicObjectInstance::MovementCollisionDynamicSphere(const CDynamicSphereInstance & s) const
{
CCollisionInstanceVector::const_iterator it;
for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
{
if ((*it)->MovementCollisionDynamicSphere(s))
return true;
}
return false;
}D3DXVECTOR3 CGraphicObjectInstance::GetCollisionMovementAdjust(const CDynamicSphereInstance & s) const
{
CCollisionInstanceVector::const_iterator it;
for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
{
if ((*it)->MovementCollisionDynamicSphere(s))
return (*it)->GetCollisionMovementAdjust(s);
}
return D3DXVECTOR3(0.0f,0.0f,0.0f);
}void CGraphicObjectInstance::UpdateCollisionData(const CStaticCollisionDataVector * pscdVector)
{
ClearCollision();
OnUpdateCollisionData(pscdVector);
}DWORD CGraphicObjectInstance::GetCollisionInstanceCount()
{
return m_StaticCollisionInstanceVector.size();
}CBaseCollisionInstance * CGraphicObjectInstance::GetCollisionInstanceData(DWORD dwIndex)
{
if (dwIndex>m_StaticCollisionInstanceVector.size())
{
return 0;
}
return m_StaticCollisionInstanceVector[dwIndex];
}//////////////////////////////////////////////////////////////////////////
// Heightvoid CGraphicObjectInstance::SetHeightInstance(CAttributeInstance * pAttributeInstance)
{
m_pHeightAttributeInstance = pAttributeInstance;
}void CGraphicObjectInstance::ClearHeightInstance()
{
m_pHeightAttributeInstance = NULL;
}void CGraphicObjectInstance::UpdateHeightInstance(CAttributeInstance * pAttributeInstance)
{
ClearHeightInstance();
OnUpdateHeighInstance(pAttributeInstance);
}bool CGraphicObjectInstance::IsObjectHeight()
{
if (m_pHeightAttributeInstance)
return true;return false;
}bool CGraphicObjectInstance::GetObjectHeight(float fX, float fY, float * pfHeight)
{
if (!m_pHeightAttributeInstance)
return false;return OnGetObjectHeight(fX, fY, pfHeight);
}void CGraphicObjectInstance::SetPortal(DWORD dwIndex, int iID)
{
if (dwIndex >= PORTAL_ID_MAX_NUM)
{
assert(dwIndex < PORTAL_ID_MAX_NUM);
return;
}m_abyPortalID[dwIndex] = iID;
}int CGraphicObjectInstance::GetPortal(DWORD dwIndex)
{
if (dwIndex >= PORTAL_ID_MAX_NUM)
{
assert(dwIndex < PORTAL_ID_MAX_NUM);
return 0;
}return m_abyPortalID[dwIndex];
}GrpPbjectInstance.h
#pragma once
#include "GrpColorInstance.h"
#include "GrpScreen.h"
#include "CullingManager.h"
#include "CollisionData.h"
#include "AttributeInstance.h"
#define ENABLE_OBJ_SCALLINGenum
{
THING_OBJECT = 0xadf21f13,
TREE_OBJECT = 0x8ac9f7a6,
ACTOR_OBJECT = 0x29a76c24,
EFFECT_OBJECT = 0x1cfa97c6,
DUNGEON_OBJECT = 0x18326035,
};enum
{
PORTAL_ID_MAX_NUM = 8,
};class CGraphicObjectInstance : public CGraphicCollisionObject
{
public:
CGraphicObjectInstance();
virtual ~CGraphicObjectInstance();
virtual int GetType() const = 0;public:
const D3DXVECTOR3 &GetPosition() const;
const D3DXVECTOR3 &GetScale() const;
floatGetRotation();
floatGetYaw();
floatGetPitch();
floatGetRoll();voidSetPosition(float x, float y, float z);
voidSetPosition(const D3DXVECTOR3 & newposition);
voidSetScale(float x, float y, float z);
#ifdef ENABLE_OBJ_SCALLING
voidSetScalePosition(float x, float y, float z);
voidSetScale(float x, float y, float z, bool bScale = false);
#else
voidSetScale(float x, float y, float z);
#endif
voidSetRotation(float fRotation);
voidSetRotation(float fYaw, float fPitch, float fRoll);
voidSetRotationQuaternion(const D3DXQUATERNION &q);
voidSetRotationMatrix(const D3DXMATRIX & m);voidClear();
voidUpdate();
boolRender();
voidBlendRender();
voidRenderToShadowMap();
voidRenderShadow();
voidRenderPCBlocker();
voidDeform();
voidTransform();voidShow();
voidHide();
boolisShow();// Camera Block
voidBlockCamera(bool bBlock) {m_BlockCamera = bBlock;}
boolBlockCamera() { return m_BlockCamera; }// Ray Test
boolisIntersect(const CRay & c_rRay, float * pu, float * pv, float * pt);// Bounding Box
D3DXVECTOR4 &GetWTBBoxVertex(const unsigned char & c_rucNumTBBoxVertex);
D3DXVECTOR3 &GetTBBoxMin() { return m_v3TBBoxMin; }
D3DXVECTOR3 &GetTBBoxMax() { return m_v3TBBoxMax; }
D3DXVECTOR3 &GetBBoxMin() { return m_v3BBoxMin; }
D3DXVECTOR3 &GetBBoxMax() { return m_v3BBoxMax; }// Matrix
D3DXMATRIX &GetTransform();
const D3DXMATRIX&GetWorldMatrix() { return m_worldMatrix; }// Portal
voidSetPortal(DWORD dwIndex, int iID);
intGetPortal(DWORD dwIndex);// Initialize
voidInitialize();
virtual voidOnInitialize();// Bounding Sphere
public:
voidUpdateBoundingSphere();
voidRegisterBoundingSphere();
virtual boolGetBoundingSphere(D3DXVECTOR3 & v3Center, float & fRadius) = 0;virtual voidOnRender() = 0;
virtual voidOnBlendRender() = 0;
virtual voidOnRenderToShadowMap() = 0;
virtual voidOnRenderShadow() = 0;
virtual voidOnRenderPCBlocker() = 0;
virtual voidOnClear(){}
virtual voidOnUpdate(){}
virtual voidOnDeform(){}protected:
D3DXVECTOR3m_v3Position;
D3DXVECTOR3m_v3Scale;floatm_fYaw;
floatm_fPitch;
floatm_fRoll;D3DXMATRIXm_mRotation;
boolm_isVisible;
D3DXMATRIXm_worldMatrix;// Camera Block
boolm_BlockCamera;// Bounding Box
D3DXVECTOR4m_v4TBBox[8];
D3DXVECTOR3m_v3TBBoxMin, m_v3TBBoxMax;
D3DXVECTOR3m_v3BBoxMin, m_v3BBoxMax;// Portal
BYTEm_abyPortalID[PORTAL_ID_MAX_NUM];// Culling
CCullingManager::CullingHandle m_CullingHandle;
#ifdef ENABLE_OBJ_SCALLING
D3DXVECTOR3 m_v3ScalePosition;
D3DXMATRIX m_ScaleMatrix, m_PositionMatrix, m_TransformMatrix;
#endif// Static Collision Data
public:
voidAddCollision(const CStaticCollisionData * pscd, const D3DXMATRIX * pMat);
voidClearCollision();
boolCollisionDynamicSphere(const CDynamicSphereInstance & s) const;
boolMovementCollisionDynamicSphere(const CDynamicSphereInstance & s) const;
D3DXVECTOR3GetCollisionMovementAdjust(const CDynamicSphereInstance & s) const;voidUpdateCollisionData(const CStaticCollisionDataVector * pscdVector = 0);
protected:
CCollisionInstanceVector m_StaticCollisionInstanceVector;
virtual voidOnUpdateCollisionData(const CStaticCollisionDataVector * pscdVector) = 0;// using in WorldEditor
public:
DWORDGetCollisionInstanceCount();
CBaseCollisionInstance * GetCollisionInstanceData(DWORD dwIndex);// Height Data
public:
voidSetHeightInstance(CAttributeInstance * pAttributeInstance);
voidClearHeightInstance();voidUpdateHeightInstance(CAttributeInstance * pAttributeInstance = 0);
boolIsObjectHeight();
boolGetObjectHeight(float fX, float fY, float * pfHeight);protected:
CAttributeInstance *m_pHeightAttributeInstance;
virtual voidOnUpdateHeighInstance(CAttributeInstance * pAttributeInstance) = 0;
virtual boolOnGetObjectHeight(float fX, float fY, float * pfHeight) = 0;
};InstanceBase.cpp
#include "StdAfx.h"
#include "InstanceBase.h"
#include "PythonBackground.h"
#include "PythonNonPlayer.h"
#include "PythonPlayer.h"
#include "PythonCharacterManager.h"
#include "AbstractPlayer.h"
#include "AbstractApplication.h"
#include "packet.h"#include "../eterlib/StateManager.h"
#include "../gamelib/ItemManager.h"BOOL HAIR_COLOR_ENABLE=FALSE;
BOOL USE_ARMOR_SPECULAR=FALSE;
BOOL RIDE_HORSE_ENABLE=TRUE;
const float c_fDefaultRotationSpeed = 1200.0f;
const float c_fDefaultHorseRotationSpeed = 300.0f;bool IsWall(unsigned race)
{
switch (race)
{
case 14201:
case 14202:
case 14203:
case 14204:
return true;
break;
}
return false;
}//////////////////////////////////////////////////////////////////////////////////////
CInstanceBase::SHORSE::SHORSE()
{
__Initialize();
}CInstanceBase::SHORSE::~SHORSE()
{
assert(m_pkActor==NULL);
}void CInstanceBase::SHORSE::__Initialize()
{
m_isMounting=false;
m_pkActor=NULL;
}void CInstanceBase::SHORSE::SetAttackSpeed(UINT uAtkSpd)
{
if (!IsMounting())
return;CActorInstance& rkActor=GetActorRef();
rkActor.SetAttackSpeed(uAtkSpd/100.0f);
}void CInstanceBase::SHORSE::SetMoveSpeed(UINT uMovSpd)
{
if (!IsMounting())
return;CActorInstance& rkActor=GetActorRef();
rkActor.SetMoveSpeed(uMovSpd/100.0f);
}void CInstanceBase::SHORSE::Create(const TPixelPosition& c_rkPPos, UINT eRace, UINT eHitEffect)
{
assert(NULL==m_pkActor && "CInstanceBase::SHORSE::Create - ALREADY MOUNT");m_pkActor=new CActorInstance;
CActorInstance& rkActor=GetActorRef();
rkActor.SetEventHandler(CActorInstance::IEventHandler::GetEmptyPtr());
if (!rkActor.SetRace(eRace))
{
delete m_pkActor;
m_pkActor=NULL;
return;
}rkActor.SetShape(0);
rkActor.SetBattleHitEffect(eHitEffect);
rkActor.SetAlphaValue(0.0f);
rkActor.BlendAlphaValue(1.0f, 0.5f);
rkActor.SetMoveSpeed(1.0f);
rkActor.SetAttackSpeed(1.0f);
rkActor.SetMotionMode(CRaceMotionData::MODE_GENERAL);
rkActor.Stop();
rkActor.RefreshActorInstance();rkActor.SetCurPixelPosition(c_rkPPos);
m_isMounting=true;
}void CInstanceBase::SHORSE::Destroy()
{
if (m_pkActor)
{
m_pkActor->Destroy();
delete m_pkActor;
}__Initialize();
}CActorInstance& CInstanceBase::SHORSE::GetActorRef()
{
assert(NULL!=m_pkActor && "CInstanceBase::SHORSE::GetActorRef");
return *m_pkActor;
}CActorInstance* CInstanceBase::SHORSE::GetActorPtr()
{
return m_pkActor;
}UINT CInstanceBase::SHORSE::GetLevel()
{
if (m_pkActor)
{
DWORD mount = m_pkActor->GetRace();
switch (mount)
{
case 20101:
case 20102:
case 20103:
return 1;
case 20104:
case 20105:
case 20106:
return 2;
case 20107:
case 20108:
case 20109:
case 20110: // #0000673: [M2EU] 새로운 탈것 타고 공격 안됨
case 20111: // #0000673: [M2EU] 새로운 탈것 타고 공격 안됨
case 20112: // #0000673: [M2EU] 새로운 탈것 타고 공격 안됨
case 20113: // #0000673: [M2EU] 새로운 탈것 타고 공격 안됨
case 20114:
case 20115:
case 20116:
case 20117:
case 20118:
case 20120:
case 20121:
case 20122:
case 20123:
case 20124:
case 20125:
return 3;
case 20119: // 라마단 이벤트용 흑마는 스킬불가, 공격가능한 레벨2로 설정
case 20219: // 할로윈 이벤트용 흑마는 스킬불가, 공격가능한 레벨2로 설정 (=라마단 흑마 클론)
case 20220:
case 20221:
case 20222:
case 20223:
case 20224:
case 20225:
case 20226:
case 20227:
case 20228:
case 20229:
case 20230:
case 20231:
case 20232:
return 2;
}// 마운트 확장 시스템용 특수 처리 (20201 ~ 20212 대역을 사용하고 순서대로 4개씩 나눠서 초급, 중급, 고급임)
// -- 탈것 레벨을 클라에서 측정하고 공격/스킬 사용가능 여부도 클라에서 처리하는 것 자체에 문제가 있는 듯.. [hyo]
{
// 중급 탈것은 레벨2 (공격 가능, 스킬 불가)
if ((20205 <= mount && 20208 >= mount)
(20214 == mount) (20217 == mount)// 난폭한 전갑순순록, 난폭한 전갑암순록
)
return 2;// 고급 탈것은 레벨3 (공격 가능, 스킬 가능)
if ((20209 <= mount && 20212 >= mount)
(20215 == mount) (20218 == mount) ||// 용맹한 전갑순순록, 용맹한 전갑암순록
(20220 == mount)
)
return 3;
}
}
return 0;
}bool CInstanceBase::SHORSE::IsNewMount()
{
if (!m_pkActor)
return false;
DWORD mount = m_pkActor->GetRace();if ((20205 <= mount && 20208 >= mount)
(20214 == mount) (20217 == mount)// 난폭한 전갑순순록, 난폭한 전갑암순록
)
return true;// 고급 탈것
if ((20209 <= mount && 20212 >= mount)
(20215 == mount) (20218 == mount) ||// 용맹한 전갑순순록, 용맹한 전갑암순록
(20220 == mount)
)
return true;return false;
}
bool CInstanceBase::SHORSE::CanUseSkill()
{
// 마상스킬은 말의 레벨이 3 이상이어야만 함.
if (IsMounting())
return 2 < GetLevel();return true;
}bool CInstanceBase::SHORSE::CanAttack()
{
if (IsMounting())
if (GetLevel()<=1)
return false;return true;
}bool CInstanceBase::SHORSE::IsMounting()
{
return m_isMounting;
}void CInstanceBase::SHORSE::Deform()
{
if (!IsMounting())
return;CActorInstance& rkActor=GetActorRef();
rkActor.INSTANCEBASE_Deform();
}void CInstanceBase::SHORSE::Render()
{
if (!IsMounting())
return;CActorInstance& rkActor=GetActorRef();
rkActor.Render();
}void CInstanceBase::__AttachHorseSaddle()
{
if (!IsMountingHorse())
return;
m_kHorse.m_pkActor->AttachModelInstance(CRaceData::PART_MAIN, "saddle", m_GraphicThingInstance, CRaceData::PART_MAIN);
}void CInstanceBase::__DetachHorseSaddle()
{
if (!IsMountingHorse())
return;
m_kHorse.m_pkActor->DetachModelInstance(CRaceData::PART_MAIN, m_GraphicThingInstance, CRaceData::PART_MAIN);
}//////////////////////////////////////////////////////////////////////////////////////
void CInstanceBase::BlockMovement()
{
m_GraphicThingInstance.BlockMovement();
}bool CInstanceBase::IsBlockObject(const CGraphicObjectInstance& c_rkBGObj)
{
return m_GraphicThingInstance.IsBlockObject(c_rkBGObj);
}bool CInstanceBase::AvoidObject(const CGraphicObjectInstance& c_rkBGObj)
{
return m_GraphicThingInstance.AvoidObject(c_rkBGObj);
}///////////////////////////////////////////////////////////////////////////////////
bool __ArmorVnumToShape(int iVnum, DWORD * pdwShape)
{
*pdwShape = iVnum;/////////////////////////////////////////
if (0 == iVnum 1 == iVnum)
return false;if (!USE_ARMOR_SPECULAR)
return false;CItemData * pItemData;
if (!CItemManager::Instance().GetItemDataPointer(iVnum, &pItemData))
return false;enum
{
SHAPE_VALUE_SLOT_INDEX = 3,
};*pdwShape = pItemData->GetValue(SHAPE_VALUE_SLOT_INDEX);
return true;
}// 2004.07.05.myevan.궁신탄영 끼이는 문제
class CActorInstanceBackground : public IBackground
{
public:
CActorInstanceBackground() {}
virtual ~CActorInstanceBackground() {}
bool IsBlock(int x, int y)
{
CPythonBackground& rkBG=CPythonBackground::Instance();
return rkBG.isAttrOn(x, y, CTerrainImpl::ATTRIBUTE_BLOCK);
}
};static CActorInstanceBackground gs_kActorInstBG;
bool CInstanceBase::LessRenderOrder(CInstanceBase* pkInst)
{
int nMainAlpha=(__GetAlphaValue() < 1.0f) ? 1 : 0;
int nTestAlpha=(pkInst->__GetAlphaValue() < 1.0f) ? 1 : 0;
if (nMainAlpha < nTestAlpha)
return true;
if (nMainAlpha > nTestAlpha)
return false;if (GetRace()<pkInst->GetRace())
return true;
if (GetRace()>pkInst->GetRace())
return false;if (GetShape()<pkInst->GetShape())
return true;if (GetShape()>pkInst->GetShape())
return false;UINT uLeftLODLevel=__LessRenderOrder_GetLODLevel();
UINT uRightLODLevel=pkInst->__LessRenderOrder_GetLODLevel();
if (uLeftLODLevel<uRightLODLevel)
return true;
if (uLeftLODLevel>uRightLODLevel)
return false;if (m_awPart[CRaceData::PART_WEAPON]<pkInst->m_awPart[CRaceData::PART_WEAPON])
return true;return false;
}UINT CInstanceBase::__LessRenderOrder_GetLODLevel()
{
CGrannyLODController* pLODCtrl=m_GraphicThingInstance.GetLODControllerPointer(0);
if (!pLODCtrl)
return 0;return pLODCtrl->GetLODLevel();
}bool CInstanceBase::__Background_GetWaterHeight(const TPixelPosition& c_rkPPos, float* pfHeight)
{
long lHeight;
if (!CPythonBackground::Instance().GetWaterHeight(int(c_rkPPos.x), int(c_rkPPos.y), &lHeight))
return false;*pfHeight = float(lHeight);
return true;
}bool CInstanceBase::__Background_IsWaterPixelPosition(const TPixelPosition& c_rkPPos)
{
return CPythonBackground::Instance().isAttrOn(c_rkPPos.x, c_rkPPos.y, CTerrainImpl::ATTRIBUTE_WATER);
}const float PC_DUST_RANGE = 2000.0f;
const float NPC_DUST_RANGE = 1000.0f;DWORD CInstanceBase::ms_dwUpdateCounter=0;
DWORD CInstanceBase::ms_dwRenderCounter=0;
DWORD CInstanceBase::ms_dwDeformCounter=0;CDynamicPool<CInstanceBase> CInstanceBase::ms_kPool;
bool CInstanceBase::__IsInDustRange()
{
if (!__IsExistMainInstance())
return false;CInstanceBase* pkInstMain=__GetMainInstancePtr();
float fDistance=NEW_GetDistanceFromDestInstance(*pkInstMain);
if (IsPC())
{
if (fDistance<=PC_DUST_RANGE)
return true;
}if (fDistance<=NPC_DUST_RANGE)
return true;return false;
}void CInstanceBase::__EnableSkipCollision()
{
if (__IsMainInstance())
{
TraceError("CInstanceBase::__EnableSkipCollision - 자신은 충돌검사스킵이 되면 안된다!!");
return;
}
m_GraphicThingInstance.EnableSkipCollision();
}void CInstanceBase::__DisableSkipCollision()
{
m_GraphicThingInstance.DisableSkipCollision();
}DWORD CInstanceBase::__GetShadowMapColor(float x, float y)
{
CPythonBackground& rkBG=CPythonBackground::Instance();
return rkBG.GetShadowMapColor(x, y);
}float CInstanceBase::__GetBackgroundHeight(float x, float y)
{
CPythonBackground& rkBG=CPythonBackground::Instance();
return rkBG.GetHeight(x, y);
}#ifdef __MOVIE_MODE__
BOOL CInstanceBase::IsMovieMode()
{
if (IsAffect(AFFECT_INVISIBILITY))
return true;return false;
}#endif
BOOL CInstanceBase::IsInvisibility()
{
if (IsAffect(AFFECT_INVISIBILITY))
return true;return false;
}BOOL CInstanceBase::IsParalysis()
{
return m_GraphicThingInstance.IsParalysis();
}BOOL CInstanceBase::IsGameMaster()
{
if (m_kAffectFlagContainer.IsSet(AFFECT_YMIR))
return true;
return false;
}BOOL CInstanceBase::IsSameEmpire(CInstanceBase& rkInstDst)
{
if (0 == rkInstDst.m_dwEmpireID)
return TRUE;if (IsGameMaster())
return TRUE;if (rkInstDst.IsGameMaster())
return TRUE;if (rkInstDst.m_dwEmpireID==m_dwEmpireID)
return TRUE;return FALSE;
}DWORD CInstanceBase::GetEmpireID()
{
return m_dwEmpireID;
}DWORD CInstanceBase::GetGuildID()
{
return m_dwGuildID;
}int CInstanceBase::GetAlignment()
{
return m_sAlignment;
}UINT CInstanceBase::GetAlignmentGrade()
{
if (m_sAlignment >= 12000)
return 0;
else if (m_sAlignment >= 8000)
return 1;
else if (m_sAlignment >= 4000)
return 2;
else if (m_sAlignment >= 1000)
return 3;
else if (m_sAlignment >= 0)
return 4;
else if (m_sAlignment > -4000)
return 5;
else if (m_sAlignment > -8000)
return 6;
else if (m_sAlignment > -12000)
return 7;return 8;
}int CInstanceBase::GetAlignmentType()
{
switch (GetAlignmentGrade())
{
case 0:
case 1:
case 2:
case 3:
{
return ALIGNMENT_TYPE_WHITE;
break;
}case 5:
case 6:
case 7:
case 8:
{
return ALIGNMENT_TYPE_DARK;
break;
}
}return ALIGNMENT_TYPE_NORMAL;
}BYTE CInstanceBase::GetPKMode()
{
return m_byPKMode;
}bool CInstanceBase::IsKiller()
{
return m_isKiller;
}bool CInstanceBase::IsPartyMember()
{
return m_isPartyMember;
}BOOL CInstanceBase::IsInSafe()
{
const TPixelPosition& c_rkPPosCur=m_GraphicThingInstance.NEW_GetCurPixelPositionRef();
if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
return TRUE;return FALSE;
}float CInstanceBase::CalculateDistanceSq3d(const TPixelPosition& c_rkPPosDst)
{
const TPixelPosition& c_rkPPosSrc=m_GraphicThingInstance.NEW_GetCurPixelPositionRef();
return SPixelPosition_CalculateDistanceSq3d(c_rkPPosSrc, c_rkPPosDst);
}void CInstanceBase::OnSelected()
{
#ifdef __MOVIE_MODE__
if (!__IsExistMainInstance())
return;
#endifif (IsStoneDoor())
return;if (IsDead())
return;__AttachSelectEffect();
}void CInstanceBase::OnUnselected()
{
__DetachSelectEffect();
}void CInstanceBase::OnTargeted()
{
#ifdef __MOVIE_MODE__
if (!__IsExistMainInstance())
return;
#endifif (IsStoneDoor())
return;if (IsDead())
return;__AttachTargetEffect();
}void CInstanceBase::OnUntargeted()
{
__DetachTargetEffect();
}void CInstanceBase::DestroySystem()
{
ms_kPool.Clear();
}void CInstanceBase::CreateSystem(UINT uCapacity)
{
ms_kPool.Create(uCapacity);memset(ms_adwCRCAffectEffect, 0, sizeof(ms_adwCRCAffectEffect));
ms_fDustGap=250.0f;
ms_fHorseDustGap=500.0f;
}CInstanceBase* CInstanceBase::New()
{
return ms_kPool.Alloc();
}void CInstanceBase::Delete(CInstanceBase* pkInst)
{
pkInst->Destroy();
ms_kPool.Free(pkInst);
}void CInstanceBase::SetMainInstance()
{
CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();DWORD dwVID=GetVirtualID();
rkChrMgr.SetMainInstance(dwVID);m_GraphicThingInstance.SetMainInstance();
}CInstanceBase* CInstanceBase::__GetMainInstancePtr()
{
CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();
return rkChrMgr.GetMainInstancePtr();
}void CInstanceBase::__ClearMainInstance()
{
CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();
rkChrMgr.ClearMainInstance();
}/* 실제 플레이어 캐릭터인지 조사.*/
bool CInstanceBase::__IsMainInstance()
{
if (this==__GetMainInstancePtr())
return true;return false;
}bool CInstanceBase::__IsExistMainInstance()
{
if(__GetMainInstancePtr())
return true;
else
return false;
}bool CInstanceBase::__MainCanSeeHiddenThing()
{
return false;
// CInstanceBase * pInstance = __GetMainInstancePtr();
// return pInstance->IsAffect(AFFECT_GAMJI);
}float CInstanceBase::__GetBowRange()
{
float fRange = 2500.0f - 100.0f;if (__IsMainInstance())
{
IAbstractPlayer& rPlayer=IAbstractPlayer::GetSingleton();
fRange += float(rPlayer.GetStatus(POINT_BOW_DISTANCE));
}return fRange;
}CInstanceBase* CInstanceBase::__FindInstancePtr(DWORD dwVID)
{
CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();
return rkChrMgr.GetInstancePtr(dwVID);
}bool CInstanceBase::__FindRaceType(DWORD dwRace, BYTE* pbType)
{
CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
return rkNonPlayer.GetInstanceType(dwRace, pbType);
}bool CInstanceBase::Create(const SCreateData& c_rkCreateData)
{
IAbstractApplication::GetSingleton().SkipRenderBuffering(300);SetInstanceType(c_rkCreateData.m_bType);
if (!SetRace(c_rkCreateData.m_dwRace))
return false;SetVirtualID(c_rkCreateData.m_dwVID);
if (c_rkCreateData.m_isMain)
SetMainInstance();if (IsGuildWall())
{
unsigned center_x;
unsigned center_y;c_rkCreateData.m_kAffectFlags.ConvertToPosition(¢er_x, ¢er_y);
float center_z = __GetBackgroundHeight(center_x, center_y);
NEW_SetPixelPosition(TPixelPosition(float(c_rkCreateData.m_lPosX), float(c_rkCreateData.m_lPosY), center_z));
}
else
{
SCRIPT_SetPixelPosition(float(c_rkCreateData.m_lPosX), float(c_rkCreateData.m_lPosY));
}if (0 != c_rkCreateData.m_dwMountVnum)
MountHorse(c_rkCreateData.m_dwMountVnum);SetArmor(c_rkCreateData.m_dwArmor);
if (IsPC())
{
SetHair(c_rkCreateData.m_dwHair);
#ifdef ENABLE_SASH_SYSTEM
SetSash(c_rkCreateData.m_dwSash);
#endif
SetWeapon(c_rkCreateData.m_dwWeapon);
}__Create_SetName(c_rkCreateData);
m_dwLevel = c_rkCreateData.m_dwLevel;
m_dwGuildID = c_rkCreateData.m_dwGuildID;
m_dwEmpireID = c_rkCreateData.m_dwEmpireID;SetVirtualNumber(c_rkCreateData.m_dwRace);
SetRotation(c_rkCreateData.m_fRot);SetAlignment(c_rkCreateData.m_sAlignment);
SetPKMode(c_rkCreateData.m_byPKMode);SetMoveSpeed(c_rkCreateData.m_dwMovSpd);
SetAttackSpeed(c_rkCreateData.m_dwAtkSpd);
// NOTE : Dress 를 입고 있으면 Alpha 를 넣지 않는다.
if (!IsWearingDress())
{
// NOTE : 반드시 Affect 셋팅 윗쪽에 있어야 함
m_GraphicThingInstance.SetAlphaValue(0.0f);
m_GraphicThingInstance.BlendAlphaValue(1.0f, 0.5f);
}if (!IsGuildWall())
{
SetAffectFlagContainer(c_rkCreateData.m_kAffectFlags);
}// NOTE : 반드시 Affect 셋팅 후에 해야 함
AttachTextTail();
RefreshTextTail();if (c_rkCreateData.m_dwStateFlags & ADD_CHARACTER_STATE_SPAWN)
{
if (IsAffect(AFFECT_SPAWN))
__AttachEffect(EFFECT_SPAWN_APPEAR);if (IsPC())
{
Refresh(CRaceMotionData::NAME_WAIT, true);
}
else
{
Refresh(CRaceMotionData::NAME_SPAWN, false);
}
}
else
{
Refresh(CRaceMotionData::NAME_WAIT, true);
}__AttachEmpireEffect(c_rkCreateData.m_dwEmpireID);
RegisterBoundingSphere();
if (c_rkCreateData.m_dwStateFlags & ADD_CHARACTER_STATE_DEAD)
m_GraphicThingInstance.DieEnd();SetStateFlags(c_rkCreateData.m_dwStateFlags);
m_GraphicThingInstance.SetBattleHitEffect(ms_adwCRCAffectEffect[EFFECT_HIT]);
if (!IsPC())
{
DWORD dwBodyColor = CPythonNonPlayer::Instance().GetMonsterColor(c_rkCreateData.m_dwRace);
if (0 != dwBodyColor)
{
SetModulateRenderMode();
SetAddColor(dwBodyColor);
}
}__AttachHorseSaddle();
// 길드 심볼을 위한 임시 코드, 적정 위치를 찾는 중
const int c_iGuildSymbolRace = 14200;
if (c_iGuildSymbolRace == GetRace())
{
std::string strFileName = GetGuildSymbolFileName(m_dwGuildID);
if (IsFile(strFileName.c_str()))
m_GraphicThingInstance.ChangeMaterial(strFileName.c_str());
}return true;
}void CInstanceBase::__Create_SetName(const SCreateData& c_rkCreateData)
{
if (IsGoto())
{
SetNameString("", 0);
return;
}
if (IsWarp())
{
__Create_SetWarpName(c_rkCreateData);
return;
}SetNameString(c_rkCreateData.m_stName.c_str(), c_rkCreateData.m_stName.length());
}void CInstanceBase::__Create_SetWarpName(const SCreateData& c_rkCreateData)
{
const char * c_szName;
if (CPythonNonPlayer::Instance().GetName(c_rkCreateData.m_dwRace, &c_szName))
{
std::string strName = c_szName;
int iFindingPos = strName.find_first_of(" ", 0);
if (iFindingPos > 0)
{
strName.resize(iFindingPos);
}
SetNameString(strName.c_str(), strName.length());
}
else
{
SetNameString(c_rkCreateData.m_stName.c_str(), c_rkCreateData.m_stName.length());
}
}void CInstanceBase::SetNameString(const char* c_szName, int len)
{
m_stName.assign(c_szName, len);
}bool CInstanceBase::SetRace(DWORD eRace)
{
m_dwRace = eRace;if (!m_GraphicThingInstance.SetRace(eRace))
return false;if (!__FindRaceType(m_dwRace, &m_eRaceType))
m_eRaceType=CActorInstance::TYPE_PC;return true;
}BOOL CInstanceBase::__IsChangableWeapon(int iWeaponID)
{
// 드레스 입고 있을때는 부케외의 장비는 나오지 않게..
if (IsWearingDress())
{
const int c_iBouquets[] =
{
50201, // Bouquet for Assassin
50202, // Bouquet for Shaman
50203,
50204,
0, // #0000545: [M2CN] 웨딩 드레스와 장비 착용 문제
};for (int i = 0; c_iBouquets[i] != 0; ++i)
if (iWeaponID == c_iBouquets[i])
return true;return false;
}
else
return true;
}BOOL CInstanceBase::IsWearingDress()
{
const int c_iWeddingDressShape = 201;
return c_iWeddingDressShape == m_eShape;
}BOOL CInstanceBase::IsHoldingPickAxe()
{
const int c_iPickAxeStart = 29101;
const int c_iPickAxeEnd = 29110;
return m_awPart[CRaceData::PART_WEAPON] >= c_iPickAxeStart && m_awPart[CRaceData::PART_WEAPON] <= c_iPickAxeEnd;
}BOOL CInstanceBase::IsNewMount()
{
return m_kHorse.IsNewMount();
}BOOL CInstanceBase::IsMountingHorse()
{
return m_kHorse.IsMounting();
}void CInstanceBase::MountHorse(UINT eRace)
{
m_kHorse.Destroy();
m_kHorse.Create(m_GraphicThingInstance.NEW_GetCurPixelPositionRef(), eRace, ms_adwCRCAffectEffect[EFFECT_HIT]);SetMotionMode(CRaceMotionData::MODE_HORSE);
SetRotationSpeed(c_fDefaultHorseRotationSpeed);m_GraphicThingInstance.MountHorse(m_kHorse.GetActorPtr());
m_GraphicThingInstance.Stop();
m_GraphicThingInstance.RefreshActorInstance();
}void CInstanceBase::DismountHorse()
{
m_kHorse.Destroy();
}void CInstanceBase::GetInfo(std::string* pstInfo)
{
char szInfo[256];
sprintf(szInfo, "Inst - UC %d, RC %d Pool - %d ",
ms_dwUpdateCounter,
ms_dwRenderCounter,
ms_kPool.GetCapacity()
);pstInfo->append(szInfo);
}void CInstanceBase::ResetPerformanceCounter()
{
ms_dwUpdateCounter=0;
ms_dwRenderCounter=0;
ms_dwDeformCounter=0;
}bool CInstanceBase::NEW_IsLastPixelPosition()
{
return m_GraphicThingInstance.IsPushing();
}const TPixelPosition& CInstanceBase::NEW_GetLastPixelPositionRef()
{
return m_GraphicThingInstance.NEW_GetLastPixelPositionRef();
}void CInstanceBase::NEW_SetDstPixelPositionZ(FLOAT z)
{
m_GraphicThingInstance.NEW_SetDstPixelPositionZ(z);
}void CInstanceBase::NEW_SetDstPixelPosition(const TPixelPosition& c_rkPPosDst)
{
m_GraphicThingInstance.NEW_SetDstPixelPosition(c_rkPPosDst);
}void CInstanceBase::NEW_SetSrcPixelPosition(const TPixelPosition& c_rkPPosSrc)
{
m_GraphicThingInstance.NEW_SetSrcPixelPosition(c_rkPPosSrc);
}const TPixelPosition& CInstanceBase::NEW_GetCurPixelPositionRef()
{
return m_GraphicThingInstance.NEW_GetCurPixelPositionRef();
}const TPixelPosition& CInstanceBase::NEW_GetDstPixelPositionRef()
{
return m_GraphicThingInstance.NEW_GetDstPixelPositionRef();
}const TPixelPosition& CInstanceBase::NEW_GetSrcPixelPositionRef()
{
return m_GraphicThingInstance.NEW_GetSrcPixelPositionRef();
}/////////////////////////////////////////////////////////////////////////////////////////////////
void CInstanceBase::OnSyncing()
{
m_GraphicThingInstance.__OnSyncing();
}void CInstanceBase::OnWaiting()
{
m_GraphicThingInstance.__OnWaiting();
}void CInstanceBase::OnMoving()
{
m_GraphicThingInstance.__OnMoving();
}void CInstanceBase::ChangeGuild(DWORD dwGuildID)
{
m_dwGuildID=dwGuildID;DetachTextTail();
AttachTextTail();
RefreshTextTail();
}DWORD CInstanceBase::GetPart(CRaceData::EParts part)
{
assert(part >= 0 && part < CRaceData::PART_MAX_NUM);
return m_awPart[part];
}DWORD CInstanceBase::GetShape()
{
return m_eShape;
}bool CInstanceBase::CanAct()
{
return m_GraphicThingInstance.CanAct();
}bool CInstanceBase::CanMove()
{
return m_GraphicThingInstance.CanMove();
}bool CInstanceBase::CanUseSkill()
{
if (IsPoly())
return false;if (IsWearingDress())
return false;if (IsHoldingPickAxe())
return false;if (!m_kHorse.CanUseSkill())
return false;if (!m_GraphicThingInstance.CanUseSkill())
return false;return true;
}bool CInstanceBase::CanAttack()
{
if (!m_kHorse.CanAttack())
return false;if (IsWearingDress())
return false;if (IsHoldingPickAxe())
return false;
return m_GraphicThingInstance.CanAttack();
}bool CInstanceBase::CanFishing()
{
return m_GraphicThingInstance.CanFishing();
}BOOL CInstanceBase::IsBowMode()
{
return m_GraphicThingInstance.IsBowMode();
}BOOL CInstanceBase::IsHandMode()
{
return m_GraphicThingInstance.IsHandMode();
}BOOL CInstanceBase::IsFishingMode()
{
if (CRaceMotionData::MODE_FISHING == m_GraphicThingInstance.GetMotionMode())
return true;return false;
}BOOL CInstanceBase::IsFishing()
{
return m_GraphicThingInstance.IsFishing();
}BOOL CInstanceBase::IsDead()
{
return m_GraphicThingInstance.IsDead();
}BOOL CInstanceBase::IsStun()
{
return m_GraphicThingInstance.IsStun();
}BOOL CInstanceBase::IsSleep()
{
return m_GraphicThingInstance.IsSleep();
}BOOL CInstanceBase::__IsSyncing()
{
return m_GraphicThingInstance.__IsSyncing();
}void CInstanceBase::NEW_SetOwner(DWORD dwVIDOwner)
{
m_GraphicThingInstance.SetOwner(dwVIDOwner);
}float CInstanceBase::GetLocalTime()
{
return m_GraphicThingInstance.GetLocalTime();
}void CInstanceBase::PushUDPState(DWORD dwCmdTime, const TPixelPosition& c_rkPPosDst, float fDstRot, UINT eFunc, UINT uArg)
{
}DWORD ELTimer_GetServerFrameMSec();
void CInstanceBase::PushTCPStateExpanded(DWORD dwCmdTime, const TPixelPosition& c_rkPPosDst, float fDstRot, UINT eFunc, UINT uArg, UINT uTargetVID)
{
SCommand kCmdNew;
kCmdNew.m_kPPosDst = c_rkPPosDst;
kCmdNew.m_dwChkTime = dwCmdTime+100;
kCmdNew.m_dwCmdTime = dwCmdTime;
kCmdNew.m_fDstRot = fDstRot;
kCmdNew.m_eFunc = eFunc;
kCmdNew.m_uArg = uArg;
kCmdNew.m_uTargetVID = uTargetVID;
m_kQue_kCmdNew.push_back(kCmdNew);
}void CInstanceBase::PushTCPState(DWORD dwCmdTime, const TPixelPosition& c_rkPPosDst, float fDstRot, UINT eFunc, UINT uArg)
{
if (__IsMainInstance())
{
//assert(!"CInstanceBase::PushTCPState 플레이어 자신에게 이동패킷은 오면 안된다!");
TraceError("CInstanceBase::PushTCPState 플레이어 자신에게 이동패킷은 오면 안된다!");
return;
}int nNetworkGap=ELTimer_GetServerFrameMSec()-dwCmdTime;
m_nAverageNetworkGap=(m_nAverageNetworkGap*70+nNetworkGap*30)/100;
/*
if (m_dwBaseCmdTime == 0)
{
m_dwBaseChkTime = ELTimer_GetFrameMSec()-nNetworkGap;
m_dwBaseCmdTime = dwCmdTime;Tracenf("VID[%d] 네트웍갭 [%d]", GetVirtualID(), nNetworkGap);
}
*///m_dwBaseChkTime-m_dwBaseCmdTime+ELTimer_GetServerMSec();
SCommand kCmdNew;
kCmdNew.m_kPPosDst = c_rkPPosDst;
kCmdNew.m_dwChkTime = dwCmdTime+m_nAverageNetworkGap;//m_dwBaseChkTime + (dwCmdTime - m_dwBaseCmdTime);// + nNetworkGap;
kCmdNew.m_dwCmdTime = dwCmdTime;
kCmdNew.m_fDstRot = fDstRot;
kCmdNew.m_eFunc = eFunc;
kCmdNew.m_uArg = uArg;
m_kQue_kCmdNew.push_back(kCmdNew);//int nApplyGap=kCmdNew.m_dwChkTime-ELTimer_GetServerFrameMSec();
//if (nApplyGap<-500 nApplyGap>500)
// Tracenf("VID[%d] NAME[%s] 네트웍갭 [cur:%d ave:%d] 작동시간 (%d)", GetVirtualID(), GetNameString(), nNetworkGap, m_nAverageNetworkGap, nApplyGap);
}/*
CInstanceBase::TStateQueue::iterator CInstanceBase::FindSameState(TStateQueue& rkQuekStt, DWORD dwCmdTime, UINT eFunc, UINT uArg)
{
TStateQueue::iterator i=rkQuekStt.begin();
while (rkQuekStt.end()!=i)
{
SState& rkSttEach=*i;
if (rkSttEach.m_dwCmdTime==dwCmdTime)
if (rkSttEach.m_eFunc==eFunc)
if (rkSttEach.m_uArg==uArg)
break;
++i;
}return i;
}
*/BOOL CInstanceBase::__CanProcessNetworkStatePacket()
{
if (m_GraphicThingInstance.IsDead())
return FALSE;
if (m_GraphicThingInstance.IsKnockDown())
return FALSE;
if (m_GraphicThingInstance.IsUsingSkill())
if (!m_GraphicThingInstance.CanCancelSkill())
return FALSE;return TRUE;
}BOOL CInstanceBase::__IsEnableTCPProcess(UINT eCurFunc)
{
if (m_GraphicThingInstance.IsActEmotion())
{
return FALSE;
}if (!m_bEnableTCPState)
{
if (FUNC_EMOTION != eCurFunc)
{
return FALSE;
}
}return TRUE;
}void CInstanceBase::StateProcess()
{
while (1)
{
if (m_kQue_kCmdNew.empty())
return;DWORD dwDstChkTime = m_kQue_kCmdNew.front().m_dwChkTime;
DWORD dwCurChkTime = ELTimer_GetServerFrameMSec();if (dwCurChkTime < dwDstChkTime)
return;SCommand kCmdTop = m_kQue_kCmdNew.front();
m_kQue_kCmdNew.pop_front();TPixelPosition kPPosDst = kCmdTop.m_kPPosDst;
//DWORD dwCmdTime = kCmdTop.m_dwCmdTime;
FLOAT fRotDst = kCmdTop.m_fDstRot;
UINT eFunc = kCmdTop.m_eFunc;
UINT uArg = kCmdTop.m_uArg;
UINT uVID = GetVirtualID();
UINT uTargetVID = kCmdTop.m_uTargetVID;TPixelPosition kPPosCur;
NEW_GetPixelPosition(&kPPosCur);/*
if (IsPC())
Tracenf("%d cmd: vid=%d[%s] func=%d arg=%d curPos=(%f, %f) dstPos=(%f, %f) rot=%f (time %d)",
ELTimer_GetMSec(),
uVID, m_stName.c_str(), eFunc, uArg,
kPPosCur.x, kPPosCur.y,
kPPosDst.x, kPPosDst.y, fRotDst, dwCmdTime-m_dwBaseCmdTime);
*/TPixelPosition kPPosDir = kPPosDst - kPPosCur;
float fDirLen = (float)sqrt(kPPosDir.x * kPPosDir.x + kPPosDir.y * kPPosDir.y);//Tracenf("거리 %f", fDirLen);
if (!__CanProcessNetworkStatePacket())
{
Lognf(0, "vid=%d 움직일 수 없는 상태라 스킵 IsDead=%d, IsKnockDown=%d", uVID, m_GraphicThingInstance.IsDead(), m_GraphicThingInstance.IsKnockDown());
return;
}if (!__IsEnableTCPProcess(eFunc))
{
return;
}switch (eFunc)
{
case FUNC_WAIT:
{
//Tracenf("%s (%f, %f) -> (%f, %f) 남은거리 %f", GetNameString(), kPPosCur.x, kPPosCur.y, kPPosDst.x, kPPosDst.y, fDirLen);
if (fDirLen > 1.0f)
{
//NEW_GetSrcPixelPositionRef() = kPPosCur;
//NEW_GetDstPixelPositionRef() = kPPosDst;
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);__EnableSkipCollision();
m_fDstRot = fRotDst;
m_isGoing = TRUE;m_kMovAfterFunc.eFunc = FUNC_WAIT;
if (!IsWalking())
StartWalking();//Tracen("목표정지");
}
else
{
//Tracen("현재 정지");m_isGoing = FALSE;
if (!IsWaiting())
EndWalking();SCRIPT_SetPixelPosition(kPPosDst.x, kPPosDst.y);
SetAdvancingRotation(fRotDst);
SetRotation(fRotDst);
}
break;
}case FUNC_MOVE:
{
//NEW_GetSrcPixelPositionRef() = kPPosCur;
//NEW_GetDstPixelPositionRef() = kPPosDst;
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);
m_fDstRot = fRotDst;
m_isGoing = TRUE;
__EnableSkipCollision();
//m_isSyncMov = TRUE;m_kMovAfterFunc.eFunc = FUNC_MOVE;
if (!IsWalking())
{
//Tracen("걷고 있지 않아 걷기 시작");
StartWalking();
}
else
{
//Tracen("이미 걷는중 ");
}
break;
}case FUNC_COMBO:
{
if (fDirLen >= 50.0f)
{
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);
m_fDstRot=fRotDst;
m_isGoing = TRUE;
__EnableSkipCollision();m_kMovAfterFunc.eFunc = FUNC_COMBO;
m_kMovAfterFunc.uArg = uArg;if (!IsWalking())
StartWalking();
}
else
{
//Tracen("대기 공격 정지");m_isGoing = FALSE;
if (IsWalking())
EndWalking();SCRIPT_SetPixelPosition(kPPosDst.x, kPPosDst.y);
RunComboAttack(fRotDst, uArg);
}
break;
}case FUNC_ATTACK:
{
if (fDirLen>=50.0f)
{
//NEW_GetSrcPixelPositionRef() = kPPosCur;
//NEW_GetDstPixelPositionRef() = kPPosDst;
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);
m_fDstRot = fRotDst;
m_isGoing = TRUE;
__EnableSkipCollision();
//m_isSyncMov = TRUE;m_kMovAfterFunc.eFunc = FUNC_ATTACK;
if (!IsWalking())
StartWalking();//Tracen("너무 멀어서 이동 후 공격");
}
else
{
//Tracen("노말 공격 정지");m_isGoing = FALSE;
if (IsWalking())
EndWalking();SCRIPT_SetPixelPosition(kPPosDst.x, kPPosDst.y);
BlendRotation(fRotDst);RunNormalAttack(fRotDst);
//Tracen("가깝기 때문에 워프 공격");
}
break;
}case FUNC_MOB_SKILL:
{
if (fDirLen >= 50.0f)
{
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);
m_fDstRot = fRotDst;
m_isGoing = TRUE;
__EnableSkipCollision();m_kMovAfterFunc.eFunc = FUNC_MOB_SKILL;
m_kMovAfterFunc.uArg = uArg;if (!IsWalking())
StartWalking();
}
else
{
m_isGoing = FALSE;if (IsWalking())
EndWalking();SCRIPT_SetPixelPosition(kPPosDst.x, kPPosDst.y);
BlendRotation(fRotDst);m_GraphicThingInstance.InterceptOnceMotion(CRaceMotionData::NAME_SPECIAL_1 + uArg);
}
break;
}case FUNC_EMOTION:
{
if (fDirLen>100.0f)
{
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);
m_fDstRot = fRotDst;
m_isGoing = TRUE;if (__IsMainInstance())
__EnableSkipCollision();m_kMovAfterFunc.eFunc = FUNC_EMOTION;
m_kMovAfterFunc.uArg = uArg;
m_kMovAfterFunc.uArgExpanded = uTargetVID;
m_kMovAfterFunc.kPosDst = kPPosDst;if (!IsWalking())
StartWalking();
}
else
{
__ProcessFunctionEmotion(uArg, uTargetVID, kPPosDst);
}
break;
}default:
{
if (eFunc & FUNC_SKILL)
{
if (fDirLen >= 50.0f)
{
//NEW_GetSrcPixelPositionRef() = kPPosCur;
//NEW_GetDstPixelPositionRef() = kPPosDst;
NEW_SetSrcPixelPosition(kPPosCur);
NEW_SetDstPixelPosition(kPPosDst);
m_fDstRot = fRotDst;
m_isGoing = TRUE;
//m_isSyncMov = TRUE;
__EnableSkipCollision();m_kMovAfterFunc.eFunc = eFunc;
m_kMovAfterFunc.uArg = uArg;if (!IsWalking())
StartWalking();//Tracen("너무 멀어서 이동 후 공격");
}
else
{
//Tracen("스킬 정지");m_isGoing = FALSE;
if (IsWalking())
EndWalking();SCRIPT_SetPixelPosition(kPPosDst.x, kPPosDst.y);
SetAdvancingRotation(fRotDst);
SetRotation(fRotDst);NEW_UseSkill(0, eFunc & 0x7f, uArg&0x0f, (uArg>>4) ? true : false);
//Tracen("가깝기 때문에 워프 공격");
}
}
break;
}
}
}
}void CInstanceBase::MovementProcess()
{
TPixelPosition kPPosCur;
NEW_GetPixelPosition(&kPPosCur);// 렌더링 좌표계이므로 y를 -화해서 더한다.
TPixelPosition kPPosNext;
{
const D3DXVECTOR3 & c_rkV3Mov = m_GraphicThingInstance.GetMovementVectorRef();kPPosNext.x = kPPosCur.x + (+c_rkV3Mov.x);
kPPosNext.y = kPPosCur.y + (-c_rkV3Mov.y);
kPPosNext.z = kPPosCur.z + (+c_rkV3Mov.z);
}TPixelPosition kPPosDeltaSC = kPPosCur - NEW_GetSrcPixelPositionRef();
TPixelPosition kPPosDeltaSN = kPPosNext - NEW_GetSrcPixelPositionRef();
TPixelPosition kPPosDeltaSD = NEW_GetDstPixelPositionRef() - NEW_GetSrcPixelPositionRef();float fCurLen = sqrtf(kPPosDeltaSC.x * kPPosDeltaSC.x + kPPosDeltaSC.y * kPPosDeltaSC.y);
float fNextLen = sqrtf(kPPosDeltaSN.x * kPPosDeltaSN.x + kPPosDeltaSN.y * kPPosDeltaSN.y);
float fTotalLen = sqrtf(kPPosDeltaSD.x * kPPosDeltaSD.x + kPPosDeltaSD.y * kPPosDeltaSD.y);
float fRestLen = fTotalLen - fCurLen;if (__IsMainInstance())
{
if (m_isGoing && IsWalking())
{
float fDstRot = NEW_GetAdvancingRotationFromPixelPosition(NEW_GetSrcPixelPositionRef(), NEW_GetDstPixelPositionRef());SetAdvancingRotation(fDstRot);
if (fRestLen<=0.0)
{
if (IsWalking())
EndWalking();//Tracen("목표 도달 정지");
m_isGoing = FALSE;
BlockMovement();
if (FUNC_EMOTION == m_kMovAfterFunc.eFunc)
{
DWORD dwMotionNumber = m_kMovAfterFunc.uArg;
DWORD dwTargetVID = m_kMovAfterFunc.uArgExpanded;
__ProcessFunctionEmotion(dwMotionNumber, dwTargetVID, m_kMovAfterFunc.kPosDst);
m_kMovAfterFunc.eFunc = FUNC_WAIT;
return;
}
}
}
}
else
{
if (m_isGoing && IsWalking())
{
float fDstRot = NEW_GetAdvancingRotationFromPixelPosition(NEW_GetSrcPixelPositionRef(), NEW_GetDstPixelPositionRef());SetAdvancingRotation(fDstRot);
// 만약 렌턴시가 늦어 너무 많이 이동했다면..
if (fRestLen < -100.0f)
{
NEW_SetSrcPixelPosition(kPPosCur);float fDstRot = NEW_GetAdvancingRotationFromPixelPosition(kPPosCur, NEW_GetDstPixelPositionRef());
SetAdvancingRotation(fDstRot);
//Tracenf("VID %d 오버 방향설정 (%f, %f) %f rest %f", GetVirtualID(), kPPosCur.x, kPPosCur.y, fDstRot, fRestLen);// 이동중이라면 다음번에 멈추게 한다
if (FUNC_MOVE == m_kMovAfterFunc.eFunc)
{
m_kMovAfterFunc.eFunc = FUNC_WAIT;
}
}
// 도착했다면...
else if (fCurLen <= fTotalLen && fTotalLen <= fNextLen)
{
if (m_GraphicThingInstance.IsDead() m_GraphicThingInstance.IsKnockDown())
{
__DisableSkipCollision();//Tracen("사망 상태라 동작 스킵");
m_isGoing = FALSE;
//Tracen("행동 불능 상태라 이후 동작 스킵");
}
else
{
switch (m_kMovAfterFunc.eFunc)
{
case FUNC_ATTACK:
{
if (IsWalking())
EndWalking();__DisableSkipCollision();
m_isGoing = FALSE;BlockMovement();
SCRIPT_SetPixelPosition(NEW_GetDstPixelPositionRef().x, NEW_GetDstPixelPositionRef().y);
SetAdvancingRotation(m_fDstRot);
SetRotation(m_fDstRot);RunNormalAttack(m_fDstRot);
break;
}case FUNC_COMBO:
{
if (IsWalking())
EndWalking();__DisableSkipCollision();
m_isGoing = FALSE;BlockMovement();
SCRIPT_SetPixelPosition(NEW_GetDstPixelPositionRef().x, NEW_GetDstPixelPositionRef().y);
RunComboAttack(m_fDstRot, m_kMovAfterFunc.uArg);
break;
}case FUNC_EMOTION:
{
m_isGoing = FALSE;
m_kMovAfterFunc.eFunc = FUNC_WAIT;
__DisableSkipCollision();
BlockMovement();DWORD dwMotionNumber = m_kMovAfterFunc.uArg;
DWORD dwTargetVID = m_kMovAfterFunc.uArgExpanded;
__ProcessFunctionEmotion(dwMotionNumber, dwTargetVID, m_kMovAfterFunc.kPosDst);
break;
}case FUNC_MOVE:
{
break;
}case FUNC_MOB_SKILL:
{
if (IsWalking())
EndWalking();__DisableSkipCollision();
m_isGoing = FALSE;BlockMovement();
SCRIPT_SetPixelPosition(NEW_GetDstPixelPositionRef().x, NEW_GetDstPixelPositionRef().y);
SetAdvancingRotation(m_fDstRot);
SetRotation(m_fDstRot);m_GraphicThingInstance.InterceptOnceMotion(CRaceMotionData::NAME_SPECIAL_1 + m_kMovAfterFunc.uArg);
break;
}default:
{
if (m_kMovAfterFunc.eFunc & FUNC_SKILL)
{
SetAdvancingRotation(m_fDstRot);
BlendRotation(m_fDstRot);
NEW_UseSkill(0, m_kMovAfterFunc.eFunc & 0x7f, m_kMovAfterFunc.uArg&0x0f, (m_kMovAfterFunc.uArg>>4) ? true : false);
}
else
{
//Tracenf("VID %d 스킬 공격 (%f, %f) rot %f", GetVirtualID(), NEW_GetDstPixelPositionRef().x, NEW_GetDstPixelPositionRef().y, m_fDstRot);__DisableSkipCollision();
m_isGoing = FALSE;BlockMovement();
SCRIPT_SetPixelPosition(NEW_GetDstPixelPositionRef().x, NEW_GetDstPixelPositionRef().y);
SetAdvancingRotation(m_fDstRot);
BlendRotation(m_fDstRot);
if (!IsWaiting())
{
EndWalking();
}//Tracenf("VID %d 정지 (%f, %f) rot %f IsWalking %d", GetVirtualID(), NEW_GetDstPixelPositionRef().x, NEW_GetDstPixelPositionRef().y, m_fDstRot, IsWalking());
}
break;
}
}}
}}
}if (IsWalking() m_GraphicThingInstance.IsUsingMovingSkill())
{
float fRotation = m_GraphicThingInstance.GetRotation();
float fAdvancingRotation = m_GraphicThingInstance.GetAdvancingRotation();
int iDirection = GetRotatingDirection(fRotation, fAdvancingRotation);if (DEGREE_DIRECTION_SAME != m_iRotatingDirection)
{
if (DEGREE_DIRECTION_LEFT == iDirection)
{
fRotation = fmodf(fRotation + m_fRotSpd*m_GraphicThingInstance.GetSecondElapsed(), 360.0f);
}
else if (DEGREE_DIRECTION_RIGHT == iDirection)
{
fRotation = fmodf(fRotation - m_fRotSpd*m_GraphicThingInstance.GetSecondElapsed() + 360.0f, 360.0f);
}if (m_iRotatingDirection != GetRotatingDirection(fRotation, fAdvancingRotation))
{
m_iRotatingDirection = DEGREE_DIRECTION_SAME;
fRotation = fAdvancingRotation;
}m_GraphicThingInstance.SetRotation(fRotation);
}if (__IsInDustRange())
{
float fDustDistance = NEW_GetDistanceFromDestPixelPosition(m_kPPosDust);
if (IsMountingHorse())
{
if (fDustDistance > ms_fHorseDustGap)
{
NEW_GetPixelPosition(&m_kPPosDust);
__AttachEffect(EFFECT_HORSE_DUST);
}
}
else
{
if (fDustDistance > ms_fDustGap)
{
NEW_GetPixelPosition(&m_kPPosDust);
__AttachEffect(EFFECT_DUST);
}
}
}
}
}void CInstanceBase::__ProcessFunctionEmotion(DWORD dwMotionNumber, DWORD dwTargetVID, const TPixelPosition & c_rkPosDst)
{
if (IsWalking())
EndWalkingWithoutBlending();__EnableChangingTCPState();
SCRIPT_SetPixelPosition(c_rkPosDst.x, c_rkPosDst.y);CInstanceBase * pTargetInstance = CPythonCharacterManager::Instance().GetInstancePtr(dwTargetVID);
if (pTargetInstance)
{
pTargetInstance->__EnableChangingTCPState();if (pTargetInstance->IsWalking())
pTargetInstance->EndWalkingWithoutBlending();WORD wMotionNumber1 = HIWORD(dwMotionNumber);
WORD wMotionNumber2 = LOWORD(dwMotionNumber);int src_job = RaceToJob(GetRace());
int dst_job = RaceToJob(pTargetInstance->GetRace());NEW_LookAtDestInstance(*pTargetInstance);
m_GraphicThingInstance.InterceptOnceMotion(wMotionNumber1 + dst_job);
m_GraphicThingInstance.SetRotation(m_GraphicThingInstance.GetTargetRotation());
m_GraphicThingInstance.SetAdvancingRotation(m_GraphicThingInstance.GetTargetRotation());pTargetInstance->NEW_LookAtDestInstance(*this);
pTargetInstance->m_GraphicThingInstance.InterceptOnceMotion(wMotionNumber2 + src_job);
pTargetInstance->m_GraphicThingInstance.SetRotation(pTargetInstance->m_GraphicThingInstance.GetTargetRotation());
pTargetInstance->m_GraphicThingInstance.SetAdvancingRotation(pTargetInstance->m_GraphicThingInstance.GetTargetRotation());if (pTargetInstance->__IsMainInstance())
{
IAbstractPlayer & rPlayer=IAbstractPlayer::GetSingleton();
rPlayer.EndEmotionProcess();
}
}if (__IsMainInstance())
{
IAbstractPlayer & rPlayer=IAbstractPlayer::GetSingleton();
rPlayer.EndEmotionProcess();
}
}///////////////////////////////////////////////////////////////////////////////////////////////////
// Update & Deform & Renderint g_iAccumulationTime = 0;
void CInstanceBase::Update()
{
++ms_dwUpdateCounter;StateProcess();
m_GraphicThingInstance.PhysicsProcess();
m_GraphicThingInstance.RotationProcess();
m_GraphicThingInstance.ComboProcess();
m_GraphicThingInstance.AccumulationMovement();if (m_GraphicThingInstance.IsMovement())
{
TPixelPosition kPPosCur;
NEW_GetPixelPosition(&kPPosCur);DWORD dwCurTime=ELTimer_GetFrameMSec();
//if (m_dwNextUpdateHeightTime<dwCurTime)
{
m_dwNextUpdateHeightTime=dwCurTime;
kPPosCur.z = __GetBackgroundHeight(kPPosCur.x, kPPosCur.y);
NEW_SetPixelPosition(kPPosCur);
}// SetMaterialColor
{
DWORD dwMtrlColor=__GetShadowMapColor(kPPosCur.x, kPPosCur.y);
m_GraphicThingInstance.SetMaterialColor(dwMtrlColor);
}
}m_GraphicThingInstance.UpdateAdvancingPointInstance();
AttackProcess();
MovementProcess();m_GraphicThingInstance.MotionProcess(IsPC());
if (IsMountingHorse())
{
m_kHorse.m_pkActor->HORSE_MotionProcess(FALSE);
}__ComboProcess();
ProcessDamage();}
void CInstanceBase::Transform()
{
if (__IsSyncing())
{
//OnSyncing();
}
else
{
if (IsWalking() m_GraphicThingInstance.IsUsingMovingSkill())
{
const D3DXVECTOR3& c_rv3Movment=m_GraphicThingInstance.GetMovementVectorRef();float len=(c_rv3Movment.x*c_rv3Movment.x)+(c_rv3Movment.y*c_rv3Movment.y);
if (len>1.0f)
OnMoving();
else
OnWaiting();
}
}m_GraphicThingInstance.INSTANCEBASE_Transform();
}void CInstanceBase::Deform()
{
// 2004.07.17.levites.isShow를 ViewFrustumCheck로 변경
if (!__CanRender())
return;++ms_dwDeformCounter;
m_GraphicThingInstance.INSTANCEBASE_Deform();
m_kHorse.Deform();
}void CInstanceBase::RenderTrace()
{
if (!__CanRender())
return;m_GraphicThingInstance.RenderTrace();
}void CInstanceBase::Render()
{
// 2004.07.17.levites.isShow를 ViewFrustumCheck로 변경
if (!__CanRender())
return;++ms_dwRenderCounter;
m_kHorse.Render();
m_GraphicThingInstance.Render();
if (CActorInstance::IsDirLine())
{
if (NEW_GetDstPixelPositionRef().x != 0.0f)
{
static CScreen s_kScreen;STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
STATEMANAGER.SaveRenderState(D3DRS_ZENABLE, FALSE);
STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, FALSE);
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, FALSE);TPixelPosition px;
m_GraphicThingInstance.GetPixelPosition(&px);
D3DXVECTOR3 kD3DVt3Cur(px.x, px.y, px.z);
//D3DXVECTOR3 kD3DVt3Cur(NEW_GetSrcPixelPositionRef().x, -NEW_GetSrcPixelPositionRef().y, NEW_GetSrcPixelPositionRef().z);
D3DXVECTOR3 kD3DVt3Dest(NEW_GetDstPixelPositionRef().x, -NEW_GetDstPixelPositionRef().y, NEW_GetDstPixelPositionRef().z);//printf("%s %f\n", GetNameString(), kD3DVt3Cur.y - kD3DVt3Dest.y);
//float fdx = NEW_GetDstPixelPositionRef().x - NEW_GetSrcPixelPositionRef().x;
//float fdy = NEW_GetDstPixelPositionRef().y - NEW_GetSrcPixelPositionRef().y;s_kScreen.SetDiffuseColor(0.0f, 0.0f, 1.0f);
s_kScreen.RenderLine3d(kD3DVt3Cur.x, kD3DVt3Cur.y, px.z, kD3DVt3Dest.x, kD3DVt3Dest.y, px.z);
STATEMANAGER.RestoreRenderState(D3DRS_ZENABLE);
STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, TRUE);
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, TRUE);
}
}
}void CInstanceBase::RenderToShadowMap()
{
if (IsDoor())
return;if (IsBuilding())
return;if (!__CanRender())
return;if (!__IsExistMainInstance())
return;CInstanceBase* pkInstMain=__GetMainInstancePtr();
const float SHADOW_APPLY_DISTANCE = 2500.0f;
float fDistance=NEW_GetDistanceFromDestInstance(*pkInstMain);
if (fDistance>=SHADOW_APPLY_DISTANCE)
return;m_GraphicThingInstance.RenderToShadowMap();
}void CInstanceBase::RenderCollision()
{
m_GraphicThingInstance.RenderCollisionData();
}///////////////////////////////////////////////////////////////////////////////////////////////////
// Setting & Getting Datavoid CInstanceBase::SetVirtualID(DWORD dwVirtualID)
{
m_GraphicThingInstance.SetVirtualID(dwVirtualID);
}void CInstanceBase::SetVirtualNumber(DWORD dwVirtualNumber)
{
m_dwVirtualNumber = dwVirtualNumber;
}void CInstanceBase::SetInstanceType(int iInstanceType)
{
m_GraphicThingInstance.SetActorType(iInstanceType);
}void CInstanceBase::SetAlignment(short sAlignment)
{
m_sAlignment = sAlignment;
RefreshTextTailTitle();
}void CInstanceBase::SetPKMode(BYTE byPKMode)
{
if (m_byPKMode == byPKMode)
return;m_byPKMode = byPKMode;
if (__IsMainInstance())
{
IAbstractPlayer& rPlayer=IAbstractPlayer::GetSingleton();
rPlayer.NotifyChangePKMode();
}
}void CInstanceBase::SetKiller(bool bFlag)
{
if (m_isKiller == bFlag)
return;m_isKiller = bFlag;
RefreshTextTail();
}void CInstanceBase::SetPartyMemberFlag(bool bFlag)
{
m_isPartyMember = bFlag;
}void CInstanceBase::SetStateFlags(DWORD dwStateFlags)
{
if (dwStateFlags & ADD_CHARACTER_STATE_KILLER)
SetKiller(TRUE);
else
SetKiller(FALSE);if (dwStateFlags & ADD_CHARACTER_STATE_PARTY)
SetPartyMemberFlag(TRUE);
else
SetPartyMemberFlag(FALSE);
}void CInstanceBase::SetComboType(UINT uComboType)
{
m_GraphicThingInstance.SetComboType(uComboType);
}const char * CInstanceBase::GetNameString()
{
return m_stName.c_str();
}DWORD CInstanceBase::GetRace()
{
return m_dwRace;
}bool CInstanceBase::IsConflictAlignmentInstance(CInstanceBase& rkInstVictim)
{
if (PK_MODE_PROTECT == rkInstVictim.GetPKMode())
return false;switch (GetAlignmentType())
{
case ALIGNMENT_TYPE_NORMAL:
case ALIGNMENT_TYPE_WHITE:
if (ALIGNMENT_TYPE_DARK == rkInstVictim.GetAlignmentType())
return true;
break;
case ALIGNMENT_TYPE_DARK:
if (GetAlignmentType() != rkInstVictim.GetAlignmentType())
return true;
break;
}return false;
}void CInstanceBase::SetDuelMode(DWORD type)
{
m_dwDuelMode = type;
}DWORD CInstanceBase::GetDuelMode()
{
return m_dwDuelMode;
}bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)
{
if (__IsMainInstance())
{
CPythonPlayer& rkPlayer=CPythonPlayer::Instance();
if(rkPlayer.IsObserverMode())
return false;
}if (GetVirtualID() == rkInstVictim.GetVirtualID())
return false;if (IsStone())
{
if (rkInstVictim.IsPC())
return true;
}
else if (IsPC())
{
if (rkInstVictim.IsStone())
return true;if (rkInstVictim.IsPC())
{
if (GetDuelMode())
{
switch(GetDuelMode())
{
case DUEL_CANNOTATTACK:
return false;
case DUEL_START:
if(__FindDUELKey(GetVirtualID(),rkInstVictim.GetVirtualID()))
return true;
else
return false;
}
}
if (PK_MODE_GUILD == GetPKMode())
if (GetGuildID() == rkInstVictim.GetGuildID())
return false;if (rkInstVictim.IsKiller())
if (!IAbstractPlayer::GetSingleton().IsSamePartyMember(GetVirtualID(), rkInstVictim.GetVirtualID()))
return true;if (PK_MODE_PROTECT != GetPKMode())
{
if (PK_MODE_FREE == GetPKMode())
{
if (PK_MODE_PROTECT != rkInstVictim.GetPKMode())
if (!IAbstractPlayer::GetSingleton().IsSamePartyMember(GetVirtualID(), rkInstVictim.GetVirtualID()))
return true;
}
if (PK_MODE_GUILD == GetPKMode())
{
if (PK_MODE_PROTECT != rkInstVictim.GetPKMode())
if (!IAbstractPlayer::GetSingleton().IsSamePartyMember(GetVirtualID(), rkInstVictim.GetVirtualID()))
if (GetGuildID() != rkInstVictim.GetGuildID())
return true;
}
}if (IsSameEmpire(rkInstVictim))
{
if (IsPVPInstance(rkInstVictim))
return true;if (PK_MODE_REVENGE == GetPKMode())
if (!IAbstractPlayer::GetSingleton().IsSamePartyMember(GetVirtualID(), rkInstVictim.GetVirtualID()))
if (IsConflictAlignmentInstance(rkInstVictim))
return true;
}
else
{
return true;
}
}if (rkInstVictim.IsEnemy())
return true;if (rkInstVictim.IsWoodenDoor())
return true;
}
else if (IsEnemy())
{
if (rkInstVictim.IsPC())
return true;if (rkInstVictim.IsBuilding())
return true;}
else if (IsPoly())
{
if (rkInstVictim.IsPC())
return true;if (rkInstVictim.IsEnemy())
return true;
}
return false;
}bool CInstanceBase::IsTargetableInstance(CInstanceBase& rkInstVictim)
{
return rkInstVictim.CanPickInstance();
}// 2004. 07. 07. [levites] - 스킬 사용중 타겟이 바뀌는 문제 해결을 위한 코드
bool CInstanceBase::CanChangeTarget()
{
return m_GraphicThingInstance.CanChangeTarget();
}// 2004.07.17.levites.isShow를 ViewFrustumCheck로 변경
bool CInstanceBase::CanPickInstance()
{
if (!__IsInViewFrustum())
return false;if (IsDoor())
{
if (IsDead())
return false;
}if (IsPC())
{
if (IsAffect(AFFECT_EUNHYEONG))
{
if (!__MainCanSeeHiddenThing())
return false;
}
if (IsAffect(AFFECT_REVIVE_INVISIBILITY))
return false;
if (IsAffect(AFFECT_INVISIBILITY))
return false;
}if (IsDead())
return false;return true;
}bool CInstanceBase::CanViewTargetHP(CInstanceBase& rkInstVictim)
{
if (rkInstVictim.IsStone())
return true;
if (rkInstVictim.IsWoodenDoor())
return true;
if (rkInstVictim.IsEnemy())
return true;return false;
}BOOL CInstanceBase::IsPoly()
{
return m_GraphicThingInstance.IsPoly();
}BOOL CInstanceBase::IsPC()
{
return m_GraphicThingInstance.IsPC();
}BOOL CInstanceBase::IsNPC()
{
return m_GraphicThingInstance.IsNPC();
}BOOL CInstanceBase::IsEnemy()
{
return m_GraphicThingInstance.IsEnemy();
}BOOL CInstanceBase::IsStone()
{
return m_GraphicThingInstance.IsStone();
}BOOL CInstanceBase::IsGuildWall() //IsBuilding 길드건물전체 IsGuildWall은 담장벽만(문은 제외)
{
return IsWall(m_dwRace);
}BOOL CInstanceBase::IsResource()
{
switch (m_dwVirtualNumber)
{
case 20047:
case 20048:
case 20049:
case 20050:
case 20051:
case 20052:
case 20053:
case 20054:
case 20055:
case 20056:
case 20057:
case 20058:
case 20059:
case 30301:
case 30302:
case 30303:
case 30304:
case 30305:
return TRUE;
}return FALSE;
}BOOL CInstanceBase::IsWarp()
{
return m_GraphicThingInstance.IsWarp();
}BOOL CInstanceBase::IsGoto()
{
return m_GraphicThingInstance.IsGoto();
}BOOL CInstanceBase::IsObject()
{
return m_GraphicThingInstance.IsObject();
}BOOL CInstanceBase::IsBuilding()
{
return m_GraphicThingInstance.IsBuilding();
}BOOL CInstanceBase::IsDoor()
{
return m_GraphicThingInstance.IsDoor();
}BOOL CInstanceBase::IsWoodenDoor()
{
if (m_GraphicThingInstance.IsDoor())
{
int vnum = GetVirtualNumber();
if (vnum == 13000) // 나무문
return true;
else if (vnum >= 30111 && vnum <= 30119) // 사귀문
return true;
else
return false;
}
else
{
return false;
}
}BOOL CInstanceBase::IsStoneDoor()
{
return m_GraphicThingInstance.IsDoor() && 13001 == GetVirtualNumber();
}BOOL CInstanceBase::IsFlag()
{
if (GetRace() == 20035)
return TRUE;
if (GetRace() == 20036)
return TRUE;
if (GetRace() == 20037)
return TRUE;return FALSE;
}BOOL CInstanceBase::IsForceVisible()
{
if (IsAffect(AFFECT_SHOW_ALWAYS))
return TRUE;if (IsObject() IsBuilding() IsDoor() )
return TRUE;return FALSE;
}int CInstanceBase::GetInstanceType()
{
return m_GraphicThingInstance.GetActorType();
}DWORD CInstanceBase::GetVirtualID()
{
return m_GraphicThingInstance.GetVirtualID();
}DWORD CInstanceBase::GetVirtualNumber()
{
return m_dwVirtualNumber;
}// 2004.07.17.levites.isShow를 ViewFrustumCheck로 변경
bool CInstanceBase::__IsInViewFrustum()
{
return m_GraphicThingInstance.isShow();
}bool CInstanceBase::__CanRender()
{
if (!__IsInViewFrustum())
return false;
if (IsAffect(AFFECT_INVISIBILITY))
return false;return true;
}///////////////////////////////////////////////////////////////////////////////////////////////////
// Graphic Controlbool CInstanceBase::IntersectBoundingBox()
{
float u, v, t;
return m_GraphicThingInstance.Intersect(&u, &v, &t);
}bool CInstanceBase::IntersectDefendingSphere()
{
return m_GraphicThingInstance.IntersectDefendingSphere();
}float CInstanceBase::GetDistance(CInstanceBase * pkTargetInst)
{
TPixelPosition TargetPixelPosition;
pkTargetInst->m_GraphicThingInstance.GetPixelPosition(&TargetPixelPosition);
return GetDistance(TargetPixelPosition);
}float CInstanceBase::GetDistance(const TPixelPosition & c_rPixelPosition)
{
TPixelPosition PixelPosition;
m_GraphicThingInstance.GetPixelPosition(&PixelPosition);float fdx = PixelPosition.x - c_rPixelPosition.x;
float fdy = PixelPosition.y - c_rPixelPosition.y;return sqrtf((fdx*fdx) + (fdy*fdy));
}CActorInstance& CInstanceBase::GetGraphicThingInstanceRef()
{
return m_GraphicThingInstance;
}CActorInstance* CInstanceBase::GetGraphicThingInstancePtr()
{
return &m_GraphicThingInstance;
}void CInstanceBase::RefreshActorInstance()
{
m_GraphicThingInstance.RefreshActorInstance();
}void CInstanceBase::Refresh(DWORD dwMotIndex, bool isLoop)
{
RefreshState(dwMotIndex, isLoop);
}void CInstanceBase::RestoreRenderMode()
{
m_GraphicThingInstance.RestoreRenderMode();
}void CInstanceBase::SetAddRenderMode()
{
m_GraphicThingInstance.SetAddRenderMode();
}void CInstanceBase::SetModulateRenderMode()
{
m_GraphicThingInstance.SetModulateRenderMode();
}void CInstanceBase::SetRenderMode(int iRenderMode)
{
m_GraphicThingInstance.SetRenderMode(iRenderMode);
}void CInstanceBase::SetAddColor(const D3DXCOLOR & c_rColor)
{
m_GraphicThingInstance.SetAddColor(c_rColor);
}void CInstanceBase::__SetBlendRenderingMode()
{
m_GraphicThingInstance.SetBlendRenderMode();
}void CInstanceBase::__SetAlphaValue(float fAlpha)
{
m_GraphicThingInstance.SetAlphaValue(fAlpha);
}float CInstanceBase::__GetAlphaValue()
{
return m_GraphicThingInstance.GetAlphaValue();
}///////////////////////////////////////////////////////////////////////////////////////////////////
// Partvoid CInstanceBase::SetHair(DWORD eHair)
{
if (!HAIR_COLOR_ENABLE)
return;if (IsPC()==false)
return;
m_awPart[CRaceData::PART_HAIR] = eHair;
m_GraphicThingInstance.SetHair(eHair);
}void CInstanceBase::ChangeHair(DWORD eHair)
{
if (!HAIR_COLOR_ENABLE)
return;if (IsPC()==false)
return;if (GetPart(CRaceData::PART_HAIR)==eHair)
return;SetHair(eHair);
//int type = m_GraphicThingInstance.GetMotionMode();
RefreshState(CRaceMotionData::NAME_WAIT, true);
//RefreshState(type, true);
}void CInstanceBase::SetArmor(DWORD dwArmor)
{
DWORD dwShape;
if (__ArmorVnumToShape(dwArmor, &dwShape))
{
CItemData * pItemData;
if (CItemManager::Instance().GetItemDataPointer(dwArmor, &pItemData))
{
float fSpecularPower=pItemData->GetSpecularPowerf();
SetShape(dwShape, fSpecularPower);
__GetRefinedEffect(pItemData);
return;
}
else
__ClearArmorRefineEffect();
}SetShape(dwArmor);
}#ifdef ENABLE_SASH_SYSTEM
void CInstanceBase::SetSash(DWORD dwSash)
{
if (!IsPC())
return;
if (IsPoly())
return;
dwSash += 85000;
ClearSashEffect();
float fSpecular = 65.0f;
if (dwSash > 86000)
{
dwSash -= 1000;
fSpecular += 35;m_dwSashEffect = EFFECT_REFINED + EFFECT_SASH;
__EffectContainer_AttachEffect(m_dwSashEffect);
}
fSpecular /= 100.0f;
m_awPart[CRaceData::PART_SASH] = dwSash;
CItemData * pItemData;
if (!CItemManager::Instance().GetItemDataPointer(dwSash, &pItemData))
return;
m_GraphicThingInstance.AttachSash(pItemData, fSpecular);
#ifdef ENABLE_OBJ_SCALLING
DWORD dwRace = GetRace(), dwPos = RaceToJob(dwRace), dwSex = RaceToSex(dwRace);
dwPos += 1;
if (dwSex == 0)
dwPos += 5;
float fScaleX, fScaleY, fScaleZ, fPositionX, fPositionY, fPositionZ;
if (pItemData->GetItemScale(dwPos, fScaleX, fScaleY, fScaleZ, fPositionX, fPositionY, fPositionZ))
{
m_GraphicThingInstance.SetScale(fScaleX, fScaleY, fScaleZ, true);
if (m_kHorse.IsMounting())
fPositionZ += 10.0f;m_GraphicThingInstance.SetScalePosition(fPositionX, fPositionY, fPositionZ);
}
#endif
}void CInstanceBase::ChangeSash(DWORD dwSash)
{
if (!IsPC())
return;
SetSash(dwSash);
}void CInstanceBase::ClearSashEffect()
{
if (!m_dwSashEffect)
return;
__EffectContainer_DetachEffect(m_dwSashEffect);
m_dwSashEffect = 0;
}
#endifvoid CInstanceBase::SetShape(DWORD eShape, float fSpecular)
{
if (IsPoly())
{
m_GraphicThingInstance.SetShape(0);
}
else
{
m_GraphicThingInstance.SetShape(eShape, fSpecular);
}m_eShape = eShape;
}DWORD CInstanceBase::GetWeaponType()
{
DWORD dwWeapon = GetPart(CRaceData::PART_WEAPON);
CItemData * pItemData;
if (!CItemManager::Instance().GetItemDataPointer(dwWeapon, &pItemData))
return CItemData::WEAPON_NONE;return pItemData->GetWeaponType();
}/*
void CInstanceBase::SetParts(const WORD * c_pParts)
{
if (IsPoly())
return;if (__IsShapeAnimalWear())
return;UINT eWeapon=c_pParts[CRaceData::PART_WEAPON];
if (__IsChangableWeapon(eWeapon) == false)
eWeapon = 0;if (eWeapon != m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON))
{
m_GraphicThingInstance.AttachPart(CRaceData::PART_MAIN, CRaceData::PART_WEAPON, eWeapon);
m_awPart[CRaceData::PART_WEAPON] = eWeapon;
}__AttachHorseSaddle();
}
*/void CInstanceBase::__ClearWeaponRefineEffect()
{
if (m_swordRefineEffectRight)
{
__DetachEffect(m_swordRefineEffectRight);
m_swordRefineEffectRight = 0;
}
if (m_swordRefineEffectLeft)
{
__DetachEffect(m_swordRefineEffectLeft);
m_swordRefineEffectLeft = 0;
}
}void CInstanceBase::__ClearArmorRefineEffect()
{
if (m_armorRefineEffect)
{
__DetachEffect(m_armorRefineEffect);
m_armorRefineEffect = 0;
}
}UINT CInstanceBase::__GetRefinedEffect(CItemData* pItem)
{
DWORD refine = max(pItem->GetRefine() + pItem->GetSocketCount(),CItemData::ITEM_SOCKET_MAX_NUM) - CItemData::ITEM_SOCKET_MAX_NUM;
switch (pItem->GetType())
{
case CItemData::ITEM_TYPE_WEAPON:
__ClearWeaponRefineEffect();
if (refine < 7) //현재 제련도 7 이상만 이펙트가 있습니다.
return 0;
switch(pItem->GetSubType())
{
case CItemData::WEAPON_DAGGER:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7+refine-7;
m_swordRefineEffectLeft = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7_LEFT+refine-7;
break;
case CItemData::WEAPON_FAN:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_FANBELL_REFINED7+refine-7;
break;
case CItemData::WEAPON_ARROW:
case CItemData::WEAPON_BELL:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7+refine-7;
break;
case CItemData::WEAPON_BOW:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_BOW_REFINED7+refine-7;
break;
default:
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_REFINED7+refine-7;
}
if (m_swordRefineEffectRight)
m_swordRefineEffectRight = __AttachEffect(m_swordRefineEffectRight);
if (m_swordRefineEffectLeft)
m_swordRefineEffectLeft = __AttachEffect(m_swordRefineEffectLeft);
break;
case CItemData::ITEM_TYPE_ARMOR:
__ClearArmorRefineEffect();// 갑옷 특화 이펙트
if (pItem->GetSubType() == CItemData::ARMOR_BODY)
{
DWORD vnum = pItem->GetIndex();if (12010 <= vnum && vnum <= 12049)
{
__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL);
__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL2);
}
}if (refine < 7) //현재 제련도 7 이상만 이펙트가 있습니다.
return 0;if (pItem->GetSubType() == CItemData::ARMOR_BODY)
{
m_armorRefineEffect = EFFECT_REFINED+EFFECT_BODYARMOR_REFINED7+refine-7;
__AttachEffect(m_armorRefineEffect);
}
break;
}
return 0;
}bool CInstanceBase::SetWeapon(DWORD eWeapon)
{
if (IsPoly())
return false;
if (__IsShapeAnimalWear())
return false;
if (__IsChangableWeapon(eWeapon) == false)
eWeapon = 0;m_GraphicThingInstance.AttachWeapon(eWeapon);
m_awPart[CRaceData::PART_WEAPON] = eWeapon;
//Weapon Effect
CItemData * pItemData;
if (CItemManager::Instance().GetItemDataPointer(eWeapon, &pItemData))
__GetRefinedEffect(pItemData);
else
__ClearWeaponRefineEffect();return true;
}void CInstanceBase::ChangeWeapon(DWORD eWeapon)
{
if (eWeapon == m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON))
return;if (SetWeapon(eWeapon))
RefreshState(CRaceMotionData::NAME_WAIT, true);
}bool CInstanceBase::ChangeArmor(DWORD dwArmor)
{
DWORD eShape;
__ArmorVnumToShape(dwArmor, &eShape);if (GetShape()==eShape)
return false;CAffectFlagContainer kAffectFlagContainer;
kAffectFlagContainer.CopyInstance(m_kAffectFlagContainer);DWORD dwVID = GetVirtualID();
DWORD dwRace = GetRace();
DWORD eHair = GetPart(CRaceData::PART_HAIR);
#ifdef ENABLE_SASH_SYSTEM
DWORD dwSash = GetPart(CRaceData::PART_SASH);
#endif
DWORD eWeapon = GetPart(CRaceData::PART_WEAPON);
float fRot = GetRotation();
float fAdvRot = GetAdvancingRotation();if (IsWalking())
EndWalking();// 2004.07.25.myevan.이펙트 안 붙는 문제
//////////////////////////////////////////////////////
__ClearAffects();
//////////////////////////////////////////////////////if (!SetRace(dwRace))
{
TraceError("CPythonCharacterManager::ChangeArmor - SetRace VID[%d] Race[%d] ERROR", dwVID, dwRace);
return false;
}SetArmor(dwArmor);
SetHair(eHair);
#ifdef ENABLE_SASH_SYSTEM
SetSash(dwSash);
#endif
SetWeapon(eWeapon);SetRotation(fRot);
SetAdvancingRotation(fAdvRot);__AttachHorseSaddle();
RefreshState(CRaceMotionData::NAME_WAIT, TRUE);
// 2004.07.25.myevan.이펙트 안 붙는 문제
/////////////////////////////////////////////////
SetAffectFlagContainer(kAffectFlagContainer);
/////////////////////////////////////////////////CActorInstance::IEventHandler& rkEventHandler=GetEventHandlerRef();
rkEventHandler.OnChangeShape();return true;
}bool CInstanceBase::__IsShapeAnimalWear()
{
if (100 == GetShape()
101 == GetShape()
102 == GetShape()
103 == GetShape())
return true;return false;
}DWORD CInstanceBase::__GetRaceType()
{
return m_eRaceType;
}void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop)
{
DWORD dwPartItemID = m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON);BYTE byItemType = 0xff;
BYTE bySubType = 0xff;CItemManager & rkItemMgr = CItemManager::Instance();
CItemData * pItemData;
if (rkItemMgr.GetItemDataPointer(dwPartItemID, &pItemData))
{
byItemType = pItemData->GetType();
bySubType = pItemData->GetWeaponType();
}if (IsPoly())
{
SetMotionMode(CRaceMotionData::MODE_GENERAL);
}
else if (IsWearingDress())
{
SetMotionMode(CRaceMotionData::MODE_WEDDING_DRESS);
}
else if (IsHoldingPickAxe())
{
if (m_kHorse.IsMounting())
{
SetMotionMode(CRaceMotionData::MODE_HORSE);
}
else
{
SetMotionMode(CRaceMotionData::MODE_GENERAL);
}
}
else if (CItemData::ITEM_TYPE_ROD == byItemType)
{
if (m_kHorse.IsMounting())
{
SetMotionMode(CRaceMotionData::MODE_HORSE);
}
else
{
SetMotionMode(CRaceMotionData::MODE_FISHING);
}
}
else if (m_kHorse.IsMounting())
{
switch (bySubType)
{
case CItemData::WEAPON_SWORD:
SetMotionMode(CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
break;case CItemData::WEAPON_TWO_HANDED:
SetMotionMode(CRaceMotionData::MODE_HORSE_TWOHAND_SWORD); // Only Warrior
break;case CItemData::WEAPON_DAGGER:
SetMotionMode(CRaceMotionData::MODE_HORSE_DUALHAND_SWORD); // Only Assassin
break;case CItemData::WEAPON_FAN:
SetMotionMode(CRaceMotionData::MODE_HORSE_FAN); // Only Shaman
break;case CItemData::WEAPON_BELL:
SetMotionMode(CRaceMotionData::MODE_HORSE_BELL); // Only Shaman
break;case CItemData::WEAPON_BOW:
SetMotionMode(CRaceMotionData::MODE_HORSE_BOW); // Only Shaman
break;default:
SetMotionMode(CRaceMotionData::MODE_HORSE);
break;
}
}
else
{
switch (bySubType)
{
case CItemData::WEAPON_SWORD:
SetMotionMode(CRaceMotionData::MODE_ONEHAND_SWORD);
break;case CItemData::WEAPON_TWO_HANDED:
SetMotionMode(CRaceMotionData::MODE_TWOHAND_SWORD); // Only Warrior
break;case CItemData::WEAPON_DAGGER:
SetMotionMode(CRaceMotionData::MODE_DUALHAND_SWORD); // Only Assassin
break;case CItemData::WEAPON_BOW:
SetMotionMode(CRaceMotionData::MODE_BOW); // Only Assassin
break;case CItemData::WEAPON_FAN:
SetMotionMode(CRaceMotionData::MODE_FAN); // Only Shaman
break;case CItemData::WEAPON_BELL:
SetMotionMode(CRaceMotionData::MODE_BELL); // Only Shaman
break;case CItemData::WEAPON_ARROW:
default:
SetMotionMode(CRaceMotionData::MODE_GENERAL);
break;
}
}if (isLoop)
m_GraphicThingInstance.InterceptLoopMotion(dwMotIndex);
else
m_GraphicThingInstance.InterceptOnceMotion(dwMotIndex);RefreshActorInstance();
}///////////////////////////////////////////////////////////////////////////////////////////////////
// Devicevoid CInstanceBase::RegisterBoundingSphere()
{
// Stone 일 경우 DeforomNoSkin 을 하면
// 낙하하는 애니메이션 같은 경우 애니메이션이
// 바운드 박스에 영향을 미쳐 컬링이 제대로 이루어지지 않는다.
if (!IsStone())
{
m_GraphicThingInstance.DeformNoSkin();
}m_GraphicThingInstance.RegisterBoundingSphere();
}bool CInstanceBase::CreateDeviceObjects()
{
return m_GraphicThingInstance.CreateDeviceObjects();
}void CInstanceBase::DestroyDeviceObjects()
{
m_GraphicThingInstance.DestroyDeviceObjects();
}void CInstanceBase::Destroy()
{
DetachTextTail();
DismountHorse();m_kQue_kCmdNew.clear();
__EffectContainer_Destroy();
__StoneSmoke_Destroy();if (__IsMainInstance())
__ClearMainInstance();
m_GraphicThingInstance.Destroy();
__Initialize();
}void CInstanceBase::__InitializeRotationSpeed()
{
SetRotationSpeed(c_fDefaultRotationSpeed);
}void CInstanceBase::__Warrior_Initialize()
{
m_kWarrior.m_dwGeomgyeongEffect=0;
}void CInstanceBase::__Initialize()
{
__Warrior_Initialize();
__StoneSmoke_Inialize();
__EffectContainer_Initialize();
__InitializeRotationSpeed();SetEventHandler(CActorInstance::IEventHandler::GetEmptyPtr());
m_kAffectFlagContainer.Clear();
m_dwLevel = 0;
m_dwGuildID = 0;
m_dwEmpireID = 0;m_eType = 0;
m_eRaceType = 0;
m_eShape = 0;
m_dwRace = 0;
m_dwVirtualNumber = 0;m_dwBaseCmdTime=0;
m_dwBaseChkTime=0;
m_dwSkipTime=0;m_GraphicThingInstance.Initialize();
m_dwAdvActorVID=0;
m_dwLastDmgActorVID=0;m_nAverageNetworkGap=0;
m_dwNextUpdateHeightTime=0;// Moving by keyboard
m_iRotatingDirection = DEGREE_DIRECTION_SAME;// Moving by mouse
m_isTextTail = FALSE;
m_isGoing = FALSE;
NEW_SetSrcPixelPosition(TPixelPosition(0, 0, 0));
NEW_SetDstPixelPosition(TPixelPosition(0, 0, 0));m_kPPosDust = TPixelPosition(0, 0, 0);
m_kQue_kCmdNew.clear();
m_dwLastComboIndex = 0;
m_swordRefineEffectRight = 0;
m_swordRefineEffectLeft = 0;
m_armorRefineEffect = 0;
#ifdef ENABLE_SASH_SYSTEM
m_dwSashEffect = 0;
#endifm_sAlignment = 0;
m_byPKMode = 0;
m_isKiller = false;
m_isPartyMember = false;m_bEnableTCPState = TRUE;
m_stName = "";
memset(m_awPart, 0, sizeof(m_awPart));
memset(m_adwCRCAffectEffect, 0, sizeof(m_adwCRCAffectEffect));
//memset(m_adwCRCEmoticonEffect, 0, sizeof(m_adwCRCEmoticonEffect));
memset(&m_kMovAfterFunc, 0, sizeof(m_kMovAfterFunc));m_bDamageEffectType = false;
m_dwDuelMode = DUEL_NONE;
m_dwEmoticonTime = 0;
}CInstanceBase::CInstanceBase()
{
__Initialize();
}CInstanceBase::~CInstanceBase()
{
Destroy();
}void CInstanceBase::GetBoundBox(D3DXVECTOR3 * vtMin, D3DXVECTOR3 * vtMax)
{
m_GraphicThingInstance.GetBoundBox(vtMin, vtMax);
} -
Das ist lediglich ein Folgefehler. Er kann die Lib ja nicht compilen wegen der anderen Fehler.
more than one instance of overloaded functions matches the argument listDer Fehler ist hier ausschlaggebend.
Du scheinst in der Klasse CGraphicThingInstance 2 Funktionen "SetScale" zu haben.
Wie in den Errors zu sehen ist, überlädt eine der Funktionen "bool bScale = false".
Durch den Standardwert = false (welchen man nun an die Funktion nicht übergeben muss) ergibt sich bei beiden Funktionen die angegebene Argumenten Liste (float, float, float).
Nun ist die Frage welche der beiden Funktionen genutzt werden soll.
War eine der beiden schon vorhanden? Oder ist es evtl ein c&p Fehler?
Ich kann dir dazu eigentlich gerade nur eines sagen, die Klasse CGraphicThinInstance wurde nicht bearbeitet, keinerlei Veränderungen wurden vorgenommen. -
Ja, der Pfad stimmt .
Keine Ahnung was da los ist :c -
Hey,
habe das Schulterband - System versucht einzubauen.
Leider bekomme ich beim Compilen des Client Source einen Error.
Evtl könnt ihr mir dabei helfen .Bitte melden Sie sich an, um dieses Bild zu sehen.
Freue mich auf eure Antworten.
Lieben Gruß
Mur -
[CENTER]Hiermit stellen wir den Server Aureva2 vor. Wir wünschen euch viel Spaß beim Lesen der Vorstellung.
Homepage: Bitte melden Sie sich an, um diesen Link zu sehen.
Forum: Bitte melden Sie sich an, um diesen Link zu sehen.AUSWEICH HOMEPAGE :Bitte melden Sie sich an, um diesen Link zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.[/CENTER] -
Hallo Com,
Wir das Team von Aureva2 suchen noch Testspieler.
Wir wollen den Server perfektionieren, hierfür brauchen wir dich!Bitte melden Sie sich an, um diesen Link zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.Interesse ? Melde dich bei uns im Forum oder Join unserer Skype Gruppe bei.
Forum : Bitte melden Sie sich an, um diesen Link zu sehen.Forum
Skype : Bitte melden Sie sich an, um diesen Link zu sehen.Mit freundlichen Grüßen
Aureva2-Team -
Hey Com,
weis vllt jemand wie ich nur das v90 toolset installieren kann ?
Installiere schon den ganzen Tag Vs08 rauf und runter, ohne dass dies richtig installiert wird .Vllt kann mir ja einer weiterhelfen .
Lieben Gruß
-
Deine Antwort hilft mir grad nicht wirklich weiter
Geanuer bitte
(query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 515, 6, -99000, 0, 423361, 0)
Erklärt sich doch ;D -
Heyo leuts,
jemand von euch ne ahnung ?
Der ganze Sysser ist vollgespamt .SYSERR: May 5 16:58:09.900954 :: Start: TABLE_POSTFIX not configured use default
SYSERR: May 5 17:13:25.345995 :: hupsig: SIGHUP, SIGINT, SIGTERM signal has been received. shutting down.
SYSERR: May 5 17:13:25.378323 :: ChildLoop: AsyncSQL: query failed: Query execution was interrupted (query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 512, 0, 0, 0, 536853675, 0) errno: 1317)
SYSERR: May 5 17:13:25.380082 :: ChildLoop: AsyncSQL: query failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 515, 6, -99000, 0, 423361, 0) errno: 2002)
SYSERR: May 5 17:13:25.380153 :: ChildLoop: AsyncSQL: retrying
SYSERR: May 5 17:13:25.380247 :: ChildLoop: AsyncSQL: query failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 515, 6, -99000, 0, 423361, 0) errno: 2002)
SYSERR: May 5 17:13:25.380281 :: ChildLoop: AsyncSQL: retrying
SYSERR: May 5 17:13:25.380338 :: ChildLoop: AsyncSQL: query failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 515, 6, -99000, 0, 423361, 0) errno: 2002)
SYSERR: May 5 17:13:25.380369 :: ChildLoop: AsyncSQL: retrying
SYSERR: May 5 17:13:25.380464 :: ChildLoop: AsyncSQL: query failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 515, 6, -99000, 0, 423361, 0) errno: 2002)
SYSERR: May 5 17:13:25.380512 :: ChildLoop: AsyncSQL: retrying
SYSERR: May 5 17:13:25.380583 :: ChildLoop: AsyncSQL: query failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (query: REPLACE INTO affect (dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost) VALUES(175, 515, 6, -99000, 0, 423361, 0) errno: 2002)
SYSERR: May 5 17:13:25.380616 :: ChildLoop: AsyncSQL: retryingmysql ist an .
kann mir nicht erklären was er da vor hat
liebe grüße -
Hey Com,
unzwar habe ich jetzt drin das mein Starteq direkt nachm login an ist.
Nun hätte ich noch gerne, dass das Eq bereits boniert ist, nur weis ich nicht wie dies geht .
Das es was im Source ist , ist mir bewusst nur wüsste ich gerne wo und was genau.
Danke schonmal .
Lg -
Kann dir nicht sagen wo.
Füg einfach alles neu ein und achte auf TABs.Sind das schon tausend mal durch gegangen ..
Leider nicht wirklich hilfreich . -
sag mir mal bitte wo, bin das schon zich mal durch gegangen
-
Hey,
habe das Release von Vegas eingebaut .
Client Source compiled ohne fehler /warnings, ebenso bei Server Source keine Fehler aufzufinden.
Der Client schließt sich nach dem Login.
Der Sysser zeigt folgendes :networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 483)
0405 17:28:07005 :: ============================================================================================================
0405 17:28:07005 :: Abort!!!!
Jemand ne Idee ?
Liebe grüßeInhalt der Py:
import ui
import localeInfo
import chr
import item
import app
import skill
import player
import uiToolTip
import mathif app.ENABLE_NEW_AFFECT_POTION:
mainAffectPotion = {
"affect" : [
chr.AFFECT_POTION_1, chr.AFFECT_POTION_2, chr.AFFECT_POTION_3, chr.AFFECT_POTION_4, chr.AFFECT_POTION_5, chr.AFFECT_POTION_6
],"image" : [
("icon/item/5082%d.tga" % (i + 1)) for i in xrange(len("affect"))
],"desc" : [
localeInfo.TOOLTIP_AFFECT_POTION_1, localeInfo.TOOLTIP_AFFECT_POTION_2, localeInfo.TOOLTIP_AFFECT_POTION_3, localeInfo.TOOLTIP_AFFECT_POTION_4, localeInfo.TOOLTIP_AFFECT_POTION_5, localeInfo.TOOLTIP_AFFECT_POTION_6
]
}
# WEDDING
class LovePointImage(ui.ExpandedImageBox):FILE_PATH = "d:/ymir work/ui/pattern/LovePoint/"
FILE_DICT = {
0 : FILE_PATH + "01.dds",
1 : FILE_PATH + "02.dds",
2 : FILE_PATH + "02.dds",
3 : FILE_PATH + "03.dds",
4 : FILE_PATH + "04.dds",
5 : FILE_PATH + "05.dds",
}def __init__(self):
ui.ExpandedImageBox.__init__(self)self.loverName = ""
self.lovePoint = 0self.toolTip = uiToolTip.ToolTip(100)
self.toolTip.HideToolTip()def __del__(self):
ui.ExpandedImageBox.__del__(self)def SetLoverInfo(self, name, lovePoint):
self.loverName = name
self.lovePoint = lovePoint
self.__Refresh()def OnUpdateLovePoint(self, lovePoint):
self.lovePoint = lovePoint
self.__Refresh()def __Refresh(self):
self.lovePoint = max(0, self.lovePoint)
self.lovePoint = min(100, self.lovePoint)if 0 == self.lovePoint:
loveGrade = 0
else:
loveGrade = self.lovePoint / 25 + 1
fileName = self.FILE_DICT.get(loveGrade, self.FILE_PATH+"00.dds")try:
self.LoadImage(fileName)
except:
import dbg
dbg.TraceError("LovePointImage.SetLoverInfo(lovePoint=%d) - LoadError %s" % (self.lovePoint, fileName))self.SetScale(0.7, 0.7)
self.toolTip.ClearToolTip()
self.toolTip.SetTitle(self.loverName)
self.toolTip.AppendTextLine(localeInfo.AFF_LOVE_POINT % (self.lovePoint))
self.toolTip.ResizeToolTip()def OnMouseOverIn(self):
self.toolTip.ShowToolTip()def OnMouseOverOut(self):
self.toolTip.HideToolTip()
# END_OF_WEDDINGclass HorseImage(ui.ExpandedImageBox):
FILE_PATH = "d:/ymir work/ui/pattern/HorseState/"
FILE_DICT = {
00 : FILE_PATH+"00.dds",
01 : FILE_PATH+"00.dds",
02 : FILE_PATH+"00.dds",
03 : FILE_PATH+"00.dds",
10 : FILE_PATH+"10.dds",
11 : FILE_PATH+"11.dds",
12 : FILE_PATH+"12.dds",
13 : FILE_PATH+"13.dds",
20 : FILE_PATH+"20.dds",
21 : FILE_PATH+"21.dds",
22 : FILE_PATH+"22.dds",
23 : FILE_PATH+"23.dds",
30 : FILE_PATH+"30.dds",
31 : FILE_PATH+"31.dds",
32 : FILE_PATH+"32.dds",
33 : FILE_PATH+"33.dds",
}def __init__(self):
ui.ExpandedImageBox.__init__(self)#self.textLineList = []
self.toolTip = uiToolTip.ToolTip(100)
self.toolTip.HideToolTip()def __GetHorseGrade(self, level):
if 0 == level:
return 0return (level-1)/10 + 1
def SetState(self, level, health, battery):
#self.textLineList=[]
self.toolTip.ClearToolTip()if level>0:
try:
grade = self.__GetHorseGrade(level)
self.__AppendText(localeInfo.LEVEL_LIST[grade])
except IndexError:
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
returntry:
healthName=localeInfo.HEALTH_LIST[health]
if len(healthName)>0:
self.__AppendText(healthName)
except IndexError:
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
returnif health>0:
if battery==0:
self.__AppendText(localeInfo.NEEFD_REST)try:
fileName=self.FILE_DICT[health*10+battery]
except KeyError:
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery)try:
self.LoadImage(fileName)
except:
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - LoadError %s" % (level, health, battery, fileName)self.SetScale(0.7, 0.7)
def __AppendText(self, text):
self.toolTip.AppendTextLine(text)
self.toolTip.ResizeToolTip()#x=self.GetWidth()/2
#textLine = ui.TextLine()
#textLine.SetParent(self)
#textLine.SetSize(0, 0)
#textLine.SetOutline()
#textLine.Hide()
#textLine.SetPosition(x, 40+len(self.textLineList)*16)
#textLine.SetText(text)
#self.textLineList.append(textLine)def OnMouseOverIn(self):
#for textLine in self.textLineList:
# textLine.Show()self.toolTip.ShowToolTip()
def OnMouseOverOut(self):
#for textLine in self.textLineList:
# textLine.Hide()self.toolTip.HideToolTip()
# AUTO_POTION
class AutoPotionImage(ui.ExpandedImageBox):FILE_PATH_HP = "d:/ymir work/ui/pattern/auto_hpgauge/"
FILE_PATH_SP = "d:/ymir work/ui/pattern/auto_spgauge/"def __init__(self):
ui.ExpandedImageBox.__init__(self)self.loverName = ""
self.lovePoint = 0
self.potionType = player.AUTO_POTION_TYPE_HP
self.filePath = ""self.toolTip = uiToolTip.ToolTip(100)
self.toolTip.HideToolTip()def __del__(self):
ui.ExpandedImageBox.__del__(self)def SetPotionType(self, type):
self.potionType = typeif player.AUTO_POTION_TYPE_HP == type:
self.filePath = self.FILE_PATH_HP
elif player.AUTO_POTION_TYPE_SP == type:
self.filePath = self.FILE_PATH_SPdef OnUpdateAutoPotionImage(self):
self.__Refresh()def __Refresh(self):
print "__Refresh"
isActivated, currentAmount, totalAmount, slotIndex = player.GetAutoPotionInfo(self.potionType)amountPercent = (float(currentAmount) / totalAmount) * 100.0
grade = math.ceil(amountPercent / 20)if 5.0 > amountPercent:
grade = 0if 80.0 < amountPercent:
grade = 4
if 90.0 < amountPercent:
grade = 5fmt = self.filePath + "%.2d.dds"
fileName = fmt % gradeprint self.potionType, amountPercent, fileName
try:
self.LoadImage(fileName)
except:
import dbg
dbg.TraceError("AutoPotionImage.__Refresh(potionType=%d) - LoadError %s" % (self.potionType, fileName))self.SetScale(0.7, 0.7)
self.toolTip.ClearToolTip()
if player.AUTO_POTION_TYPE_HP == type:
self.toolTip.SetTitle(localeInfo.TOOLTIP_AUTO_POTION_HP)
else:
self.toolTip.SetTitle(localeInfo.TOOLTIP_AUTO_POTION_SP)self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (amountPercent))
self.toolTip.ResizeToolTip()def OnMouseOverIn(self):
self.toolTip.ShowToolTip()def OnMouseOverOut(self):
self.toolTip.HideToolTip()
# END_OF_AUTO_POTIONclass AffectImage(ui.ExpandedImageBox):
def __init__(self):
ui.ExpandedImageBox.__init__(self)self.toolTipText = None
self.isSkillAffect = TRUE
self.description = None
self.endTime = 0
self.affect = None
self.isClocked = TRUEdef SetAffect(self, affect):
self.affect = affectdef GetAffect(self):
return self.affectdef SetToolTipText(self, text, x = 0, y = -19):
if not self.toolTipText:
textLine = ui.TextLine()
textLine.SetParent(self)
textLine.SetSize(0, 0)
textLine.SetOutline()
textLine.Hide()
self.toolTipText = textLineself.toolTipText.SetText(text)
w, h = self.toolTipText.GetTextSize()
self.toolTipText.SetPosition(max(0, x + self.GetWidth()/2 - w/2), y)def SetDescription(self, description):
self.description = descriptiondef SetDuration(self, duration):
self.endTime = 0
if duration > 0:
self.endTime = app.GetGlobalTimeStamp() + durationdef UpdateAutoPotionDescription(self):
potionType = 0
if self.affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
potionType = player.AUTO_POTION_TYPE_HP
else:
potionType = player.AUTO_POTION_TYPE_SPisActivated, currentAmount, totalAmount, slotIndex = player.GetAutoPotionInfo(potionType)
#print "UpdateAutoPotionDescription ", isActivated, currentAmount, totalAmount, slotIndex
amountPercent = 0.0
try:
amountPercent = (float(currentAmount) / totalAmount) * 100.0
except:
amountPercent = 100.0self.SetToolTipText(self.description % amountPercent, 0, 40)
def SetClock(self, isClocked):
self.isClocked = isClockeddef UpdateDescription(self):
if not self.isClocked:
self.__UpdateDescription2()
return
if not self.description:
returntoolTip = self.description
if self.endTime > 0:
leftTime = localeInfo.SecondToDHM(self.endTime - app.GetGlobalTimeStamp())
toolTip += " (%s : %s)" % (localeInfo.LEFT_TIME, leftTime)
self.SetToolTipText(toolTip, 0, 40)#독일버전에서 시간을 제거하기 위해서 사용
def __UpdateDescription2(self):
if not self.description:
returntoolTip = self.description
self.SetToolTipText(toolTip, 0, 40)def SetSkillAffectFlag(self, flag):
self.isSkillAffect = flagdef IsSkillAffect(self):
return self.isSkillAffectdef OnMouseOverIn(self):
if self.toolTipText:
self.toolTipText.Show()def OnMouseOverOut(self):
if self.toolTipText:
self.toolTipText.Hide()class AffectShower(ui.Window):
MALL_DESC_IDX_START = 1000
IMAGE_STEP = 25
AFFECT_MAX_NUM = 32INFINITE_AFFECT_DURATION = 0x1FFFFFFF
AFFECT_DATA_DICT = {
chr.AFFECT_POISON : (localeInfo.SKILL_TOXICDIE, "d:/ymir work/ui/skill/common/affect/poison.sub"),
chr.AFFECT_SLOW : (localeInfo.SKILL_SLOW, "d:/ymir work/ui/skill/common/affect/slow.sub"),
chr.AFFECT_STUN : (localeInfo.SKILL_STUN, "d:/ymir work/ui/skill/common/affect/stun.sub"),chr.AFFECT_ATT_SPEED_POTION : (localeInfo.SKILL_INC_ATKSPD, "d:/ymir work/ui/skill/common/affect/Increase_Attack_Speed.sub"),
chr.AFFECT_MOV_SPEED_POTION : (localeInfo.SKILL_INC_MOVSPD, "d:/ymir work/ui/skill/common/affect/Increase_Move_Speed.sub"),
chr.AFFECT_FISH_MIND : (localeInfo.SKILL_FISHMIND, "d:/ymir work/ui/skill/common/affect/fishmind.sub"),chr.AFFECT_JEONGWI : (localeInfo.SKILL_JEONGWI, "d:/ymir work/ui/skill/warrior/jeongwi_03.sub",),
chr.AFFECT_GEOMGYEONG : (localeInfo.SKILL_GEOMGYEONG, "d:/ymir work/ui/skill/warrior/geomgyeong_03.sub",),
chr.AFFECT_CHEONGEUN : (localeInfo.SKILL_CHEONGEUN, "d:/ymir work/ui/skill/warrior/cheongeun_03.sub",),
chr.AFFECT_GYEONGGONG : (localeInfo.SKILL_GYEONGGONG, "d:/ymir work/ui/skill/assassin/gyeonggong_03.sub",),
chr.AFFECT_EUNHYEONG : (localeInfo.SKILL_EUNHYEONG, "d:/ymir work/ui/skill/assassin/eunhyeong_03.sub",),
chr.AFFECT_GWIGEOM : (localeInfo.SKILL_GWIGEOM, "d:/ymir work/ui/skill/sura/gwigeom_03.sub",),
chr.AFFECT_GONGPO : (localeInfo.SKILL_GONGPO, "d:/ymir work/ui/skill/sura/gongpo_03.sub",),
chr.AFFECT_JUMAGAP : (localeInfo.SKILL_JUMAGAP, "d:/ymir work/ui/skill/sura/jumagap_03.sub"),
chr.AFFECT_HOSIN : (localeInfo.SKILL_HOSIN, "d:/ymir work/ui/skill/shaman/hosin_03.sub",),
chr.AFFECT_BOHO : (localeInfo.SKILL_BOHO, "d:/ymir work/ui/skill/shaman/boho_03.sub",),
chr.AFFECT_KWAESOK : (localeInfo.SKILL_KWAESOK, "d:/ymir work/ui/skill/shaman/kwaesok_03.sub",),
chr.AFFECT_HEUKSIN : (localeInfo.SKILL_HEUKSIN, "d:/ymir work/ui/skill/sura/heuksin_03.sub",),
chr.AFFECT_MUYEONG : (localeInfo.SKILL_MUYEONG, "d:/ymir work/ui/skill/sura/muyeong_03.sub",),
chr.AFFECT_GICHEON : (localeInfo.SKILL_GICHEON, "d:/ymir work/ui/skill/shaman/gicheon_03.sub",),
chr.AFFECT_JEUNGRYEOK : (localeInfo.SKILL_JEUNGRYEOK, "d:/ymir work/ui/skill/shaman/jeungryeok_03.sub",),
chr.AFFECT_PABEOP : (localeInfo.SKILL_PABEOP, "d:/ymir work/ui/skill/sura/pabeop_03.sub",),
chr.AFFECT_FALLEN_CHEONGEUN : (localeInfo.SKILL_CHEONGEUN, "d:/ymir work/ui/skill/warrior/cheongeun_03.sub",),
28 : (localeInfo.SKILL_FIRE, "d:/ymir work/ui/skill/sura/hwayeom_03.sub",),
chr.AFFECT_CHINA_FIREWORK : (localeInfo.SKILL_POWERFUL_STRIKE, "d:/ymir work/ui/skill/common/affect/powerfulstrike.sub",),#64 - END
chr.NEW_AFFECT_EXP_BONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/exp_bonus.sub",),chr.NEW_AFFECT_ITEM_BONUS : (localeInfo.TOOLTIP_MALL_ITEMBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/item_bonus.sub",),
chr.NEW_AFFECT_SAFEBOX : (localeInfo.TOOLTIP_MALL_SAFEBOX, "d:/ymir work/ui/skill/common/affect/safebox.sub",),
chr.NEW_AFFECT_AUTOLOOT : (localeInfo.TOOLTIP_MALL_AUTOLOOT, "d:/ymir work/ui/skill/common/affect/autoloot.sub",),
chr.NEW_AFFECT_FISH_MIND : (localeInfo.TOOLTIP_MALL_FISH_MIND, "d:/ymir work/ui/skill/common/affect/fishmind.sub",),
chr.NEW_AFFECT_MARRIAGE_FAST : (localeInfo.TOOLTIP_MALL_MARRIAGE_FAST, "d:/ymir work/ui/skill/common/affect/marriage_fast.sub",),
chr.NEW_AFFECT_GOLD_BONUS : (localeInfo.TOOLTIP_MALL_GOLDBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub",),chr.NEW_AFFECT_NO_DEATH_PENALTY : (localeInfo.TOOLTIP_APPLY_NO_DEATH_PENALTY, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
chr.NEW_AFFECT_SKILL_BOOK_BONUS : (localeInfo.TOOLTIP_APPLY_SKILL_BOOK_BONUS, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
chr.NEW_AFFECT_SKILL_BOOK_NO_DELAY : (localeInfo.TOOLTIP_APPLY_SKILL_BOOK_NO_DELAY, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),# 자동물약 hp, sp
chr.NEW_AFFECT_AUTO_HP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/pattern/auto_hpgauge/05.dds"),
chr.NEW_AFFECT_AUTO_SP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/pattern/auto_spgauge/05.dds"),
#chr.NEW_AFFECT_AUTO_HP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
#chr.NEW_AFFECT_AUTO_SP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub"),MALL_DESC_IDX_START+player.POINT_MALL_ATTBONUS : (localeInfo.TOOLTIP_MALL_ATTBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/att_bonus.sub",),
MALL_DESC_IDX_START+player.POINT_MALL_DEFBONUS : (localeInfo.TOOLTIP_MALL_DEFBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/def_bonus.sub",),
MALL_DESC_IDX_START+player.POINT_MALL_EXPBONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS, "d:/ymir work/ui/skill/common/affect/exp_bonus.sub",),
MALL_DESC_IDX_START+player.POINT_MALL_ITEMBONUS : (localeInfo.TOOLTIP_MALL_ITEMBONUS, "d:/ymir work/ui/skill/common/affect/item_bonus.sub",),
MALL_DESC_IDX_START+player.POINT_MALL_GOLDBONUS : (localeInfo.TOOLTIP_MALL_GOLDBONUS, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub",),
MALL_DESC_IDX_START+player.POINT_CRITICAL_PCT : (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,"d:/ymir work/ui/skill/common/affect/critical.sub"),
MALL_DESC_IDX_START+player.POINT_PENETRATE_PCT : (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
MALL_DESC_IDX_START+player.POINT_MAX_HP_PCT : (localeInfo.TOOLTIP_MAX_HP_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
MALL_DESC_IDX_START+player.POINT_MAX_SP_PCT : (localeInfo.TOOLTIP_MAX_SP_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),MALL_DESC_IDX_START+player.POINT_PC_BANG_EXP_BONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC, "d:/ymir work/ui/skill/common/affect/EXP_Bonus_p_on.sub",),
MALL_DESC_IDX_START+player.POINT_PC_BANG_DROP_BONUS: (localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC, "d:/ymir work/ui/skill/common/affect/Item_Bonus_p_on.sub",),
}
if app.ENABLE_DRAGON_SOUL_SYSTEM:
# 용혼석 천, 지 덱.
AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK1] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK1, "d:/ymir work/ui/dragonsoul/buff_ds_sky1.tga")
AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK2] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK2, "d:/ymir work/ui/dragonsoul/buff_ds_land1.tga")
if app.ENABLE_NEW_AFFECT_POTION:
for i in xrange(len(mainAffectPotion["affect"])):
AFFECT_DATA_DICT[mainAffectPotion["affect"][i]] = (mainAffectPotion["desc"][i], mainAffectPotion["image"][i])def __init__(self):
ui.Window.__init__(self)self.serverPlayTime=0
self.clientPlayTime=0self.lastUpdateTime=0
self.affectImageDict={}
self.horseImage=None
self.lovePointImage=None
self.autoPotionImageHP = AutoPotionImage()
self.autoPotionImageSP = AutoPotionImage()
self.SetPosition(10, 10)
self.Show()def ClearAllAffects(self):
self.horseImage=None
self.lovePointImage=None
self.affectImageDict={}
self.__ArrangeImageList()def ClearAffects(self): ## 스킬 이펙트만 없앱니다.
self.living_affectImageDict={}
for key, image in self.affectImageDict.items():
if not image.IsSkillAffect():
self.living_affectImageDict[key] = image
self.affectImageDict = self.living_affectImageDict
self.__ArrangeImageList()def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
print "BINARY_NEW_AddAffect", type, pointIdx, value, duration
if app.ENABLE_NEW_AFFECT_POTION:
if type < 500 and not type in (mainAffectPotion["affect"][i] for i in xrange(len(mainAffectPotion["affect"]))):
return
else:
if type < 500:
returnif type == chr.NEW_AFFECT_MALL:
affect = self.MALL_DESC_IDX_START + pointIdx
else:
affect = typeif self.affectImageDict.has_key(affect):
returnif not self.AFFECT_DATA_DICT.has_key(affect):
return## 용신의 가호, 선인의 교훈은 Duration 을 0 으로 설정한다.
if affect == chr.NEW_AFFECT_NO_DEATH_PENALTY or\
affect == chr.NEW_AFFECT_SKILL_BOOK_BONUS or\
affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or\
affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY or\
affect == chr.NEW_AFFECT_SKILL_BOOK_NO_DELAY:
duration = 0affectData = self.AFFECT_DATA_DICT[affect]
description = affectData[0]
filename = affectData[1]if pointIdx == player.POINT_MALL_ITEMBONUS or\
pointIdx == player.POINT_MALL_GOLDBONUS:
value = 1 + float(value) / 100.0trashValue = 123
#if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
if trashValue == 1:
try:
#image = AutoPotionImage()
#image.SetParent(self)
image = Noneif affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
image.SetPotionType(player.AUTO_POTION_TYPE_SP)
image = self.autoPotionImageSP
#self.autoPotionImageSP = image;
else:
image.SetPotionType(player.AUTO_POTION_TYPE_HP)
image = self.autoPotionImageHP
#self.autoPotionImageHP = image;image.SetParent(self)
image.Show()
image.OnUpdateAutoPotionImage()self.affectImageDict[affect] = image
self.__ArrangeImageList()except Exception, e:
print "except Aff auto potion affect ", e
passelse:
if affect != chr.NEW_AFFECT_AUTO_SP_RECOVERY and affect != chr.NEW_AFFECT_AUTO_HP_RECOVERY:
description = description(float(value))try:
print "Add affect %s" % affect
image = AffectImage()
image.SetParent(self)
image.LoadImage(filename)
image.SetDescription(description)
image.SetDuration(duration)
image.SetAffect(affect)
if affect == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE or\
affect == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE_UNDER_15 or\
self.INFINITE_AFFECT_DURATION < duration:
image.SetClock(FALSE)
image.UpdateDescription()
elif affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
image.UpdateAutoPotionDescription()
else:
image.UpdateDescription()if affect == chr.NEW_AFFECT_DRAGON_SOUL_DECK1 or affect == chr.NEW_AFFECT_DRAGON_SOUL_DECK2:
image.SetScale(1, 1)
else:
image.SetScale(0.7, 0.7)
image.SetSkillAffectFlag(FALSE)
image.Show()
self.affectImageDict[affect] = image
self.__ArrangeImageList()
except Exception, e:
print "except Aff affect ", e
passdef BINARY_NEW_RemoveAffect(self, type, pointIdx):
if type == chr.NEW_AFFECT_MALL:
affect = self.MALL_DESC_IDX_START + pointIdx
else:
affect = type
print "Remove Affect %s %s" % ( type , pointIdx )
self.__RemoveAffect(affect)
self.__ArrangeImageList()def SetAffect(self, affect):
self.__AppendAffect(affect)
self.__ArrangeImageList()def ResetAffect(self, affect):
self.__RemoveAffect(affect)
self.__ArrangeImageList()def SetLoverInfo(self, name, lovePoint):
image = LovePointImage()
image.SetParent(self)
image.SetLoverInfo(name, lovePoint)
self.lovePointImage = image
self.__ArrangeImageList()def ShowLoverState(self):
if self.lovePointImage:
self.lovePointImage.Show()
self.__ArrangeImageList()def HideLoverState(self):
if self.lovePointImage:
self.lovePointImage.Hide()
self.__ArrangeImageList()def ClearLoverState(self):
self.lovePointImage = None
self.__ArrangeImageList()def OnUpdateLovePoint(self, lovePoint):
if self.lovePointImage:
self.lovePointImage.OnUpdateLovePoint(lovePoint)def SetHorseState(self, level, health, battery):
if level==0:
self.horseImage=None
else:
image = HorseImage()
image.SetParent(self)
image.SetState(level, health, battery)
image.Show()self.horseImage=image
self.__ArrangeImageList()def SetPlayTime(self, playTime):
self.serverPlayTime = playTime
self.clientPlayTime = app.GetTime()if localeInfo.IsVIETNAM():
image = PlayTimeImage()
image.SetParent(self)
image.SetPlayTime(playTime)
image.Show()self.playTimeImage=image
self.__ArrangeImageList()def __AppendAffect(self, affect):
if self.affectImageDict.has_key(affect):
returntry:
affectData = self.AFFECT_DATA_DICT[affect]
except KeyError:
returnname = affectData[0]
filename = affectData[1]skillIndex = player.AffectIndexToSkillIndex(affect)
if 0 != skillIndex:
name = skill.GetSkillName(skillIndex)image = AffectImage()
image.SetParent(self)
image.SetSkillAffectFlag(TRUE)try:
image.LoadImage(filename)
except:
passimage.SetToolTipText(name, 0, 40)
image.SetScale(0.7, 0.7)
image.Show()
self.affectImageDict[affect] = imagedef __RemoveAffect(self, affect):
"""
if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
self.autoPotionImageSP.Hide()if affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
self.autoPotionImageHP.Hide()
"""if not self.affectImageDict.has_key(affect):
print "__RemoveAffect %s ( No Affect )" % affect
returnprint "__RemoveAffect %s ( Affect )" % affect
del self.affectImageDict[affect]self.__ArrangeImageList()
def __ArrangeImageList(self):
width = len(self.affectImageDict) * self.IMAGE_STEP
if self.lovePointImage:
width+=self.IMAGE_STEP
if self.horseImage:
width+=self.IMAGE_STEPself.SetSize(width, 26)
xPos = 0
if self.lovePointImage:
if self.lovePointImage.IsShow():
self.lovePointImage.SetPosition(xPos, 0)
xPos += self.IMAGE_STEPif self.horseImage:
self.horseImage.SetPosition(xPos, 0)
xPos += self.IMAGE_STEPfor image in self.affectImageDict.values():
image.SetPosition(xPos, 0)
xPos += self.IMAGE_STEPdef OnUpdate(self):
try:
if app.GetGlobalTime() - self.lastUpdateTime > 500:
#if 0 < app.GetGlobalTime():
self.lastUpdateTime = app.GetGlobalTime()for image in self.affectImageDict.values():
if image.GetAffect() == chr.NEW_AFFECT_AUTO_HP_RECOVERY or image.GetAffect() == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
image.UpdateAutoPotionDescription()
continueif not image.IsSkillAffect():
image.UpdateDescription()
except Exception, e:
print "AffectShower::OnUpdate error : ", e -
Hey Com,
habe das Itemdestroy drop dialog sys. verbaut, nun kann ich leider keine Sachen mehr aus dem Inventar werfen .
Die Sysser zeigt mir das hier an .0405 11:02:50815 :: Traceback (most recent call last):
0405 11:02:50815 :: File "game.py", line 1290, in OnMouseLeftButtonUp
0405 11:02:50815 :: File "game.py", line 1327, in __PutItem
0405 11:02:50816 :: File "game.py", line 1383, in __DropItem
0405 11:02:50816 :: AttributeError
0405 11:02:50816 :: :
0405 11:02:50816 :: 'QuestionDialog' object has no attribute 'SetDestroyEvent'
0405 11:02:50816 ::Eventuell kann mir ja einer helfen, py technisch bin ich wirklich kein Profi.
Liebe Grüße -
schaetze mal deine Sasheffekte haben einen bereits genutzten Effektindex
mh und bezüglich des transmutation systems ne idee ?